[atlas] / offline / TestBeam / TBCnv / TBCnv / ReadTBLArDigits.h Repository:
ViewVC logotype

View of /offline/TestBeam/TBCnv/TBCnv/ReadTBLArDigits.h

Parent Directory Parent Directory | Revision Log Revision Log | View Revision Graph Revision Graph


Revision 1.2 - (download) (annotate)
Sat Jun 12 20:29:07 2004 UTC (8 years, 11 months ago) by rmcphers
Branch: MAIN
CVS Tags: offline-10-03-00, TBCnv-00-02-23, offline-09-03-00, offline-10-00-02, offline-10-00-01, offline-10-00-00, offline-10-00-06, offline-10-00-04, TBCnv-00-02-21, TBCnv-00-02-26, TBCnv-00-02-27, offline-11-02-00, TBCnv-00-02-24, offline-08-05-00, TBCnv-00-02-25, offline-10-00-03, TBCnv-00-02-19, TBCnv-00-02-18, offline-11-00-06, offline-09-00-00, offline-11-00-04, offline-11-00-05, offline-11-00-02, offline-11-00-03, offline-11-00-00, offline-11-00-01, TestBeam-00-00-19, TBCnv-00-02-13, offline-10-05-00, offline-09-02-00, offline-11-01-00, TestBeam-AtlasOffline-00-00-08, TestBeam-AtlasOffline-00-00-01, TestBeam-AtlasOffline-00-00-00, TestBeam-AtlasOffline-00-00-03, TBCnv-00-02-43, TestBeam-AtlasOffline-00-00-05, TestBeam-AtlasOffline-00-00-04, TestBeam-AtlasOffline-00-00-07, TestBeam-AtlasOffline-00-00-06, TBCnv-00-02-11, offline-10-02-00, TBCnv-00-02-10, TestBeam-00-00-05, TestBeam-00-00-09, TestBeam-00-00-08, TBCnv-00-02-29, offline-09-01-02, offline-09-04-00, TBCnv-00-02-16, TBCnv-00-02-22, TestBeam-00-00-13, TBCnv-00-02-20, TestBeam-00-00-11, TestBeam-00-00-16, TestBeam-00-00-17, TestBeam-00-00-14, TestBeam-00-00-15, TBCnv-00-02-28, offline-11-00-41, TestBeam-AtlasRelease-00-00-00, TBCnv-00-02-40, TBCnv-00-02-41, TBCnv-00-02-42, TBCnv-00-02-31, TBCnv-00-02-30, TBCnv-00-02-33, TestBeam-AtlasOffline-00-00-02, TBCnv-00-02-35, TestBeam-00-00-22, TestBeam-00-00-21, TestBeam-00-00-20, TBCnv-00-02-39, TBCnv-00-02-44, TBCnv-00-02-45, offline-09-00-01, TBCnv-00-02-46, TBCnv-00-02-12, TBCnv-00-02-47, offline-09-00-03, offline-09-00-02, TBCnv-00-02-17, offline-09-00-04, TBCnv-00-02-15, TBCnv-00-02-14, offline-08-06-00, TBCnv-00-03-10, TBCnv-00-03-11, TBCnv-00-03-12, TBCnv-00-03-13, TBCnv-00-03-14, TBCnv-00-02-32, TestBeam-00-00-23, TBCnv-00-02-34, TBCnv-00-02-37, TBCnv-00-02-36, TBCnv-00-02-38, TBCnv-00-03-07, TBCnv-00-03-06, TBCnv-00-03-05, TBCnv-00-03-04, TBCnv-00-03-03, TBCnv-00-03-02, TBCnv-00-03-01, TBCnv-00-03-00, offline-08-04-00, TBCnv-00-03-09, TBCnv-00-03-08, TBCnv-00-02-09, offline-08-07-00, offline-08-08-00, offline-08-08-01, offline-10-04-01, offline-10-04-00, HEAD
Changes since 1.1: +5 -1 lines
Also added HEC and FCAL mapping in ReadTBLArDigit
//Dear emacs, this is -*- c++ -*-

#ifndef READLARDIGITS_H
#define READLARDIGITS_H
#include "GaudiKernel/Algorithm.h"
#include "GaudiKernel/MsgStream.h"
#include  "StoreGate/StoreGateSvc.h"
#include "TBEvent/TBLArDigitContainer.h"
// #include "LArRawEvent/LArRawChannelContainer.h"
// #include "LArRawEvent/LArRawChannelCollection.h"
#include "LArTools/LArCablingService.h"
#include "CaloIdentifier/LArEM_ID.h"
#include "CaloIdentifier/LArFCAL_ID.h"
#include "CaloIdentifier/LArHEC_ID.h"
#include "GaudiKernel/INTupleSvc.h"
#include "GaudiKernel/NTuple.h"
#include "GaudiKernel/SmartDataPtr.h"
//#include "LArDetDescr/LArDetDescrManager.h"
#include <fstream>

class ReadTBLArDigits : public Algorithm
{
 public:
  ReadTBLArDigits(const std::string & name, ISvcLocator * pSvcLocator);

  ~ReadTBLArDigits();

  //standart algorithm methods
  StatusCode initialize();
  StatusCode execute();
  StatusCode finalize();

 private:
  int m_count;
  StoreGateSvc *m_storeGateSvc;
  LArCablingService *m_larCablingSvc;
  const LArEM_ID*   m_emId;
  const LArFCAL_ID* m_fcalId;
  const LArHEC_ID*  m_hecId;
  const LArOnlineID* m_onlineHelper;
  std::ofstream m_outfile;
  std::string m_containerKey;
  std::string m_dumpFile;
  bool m_printCellLoc;
  bool m_printFebChan;
  //std::string m_NTupleLoc;
  
  NTuple::Tuple* m_ntuplePtr;
  //NTuple::Item<long> m_cellIndex;
  NTuple::Item<long> m_cellIndex;
  NTuple::Array<long> m_layer, m_eta, m_phi, m_gain;
  NTuple::Array<long> m_barrel_ec, m_pos_neg, m_FT, m_slot, m_channel;
  NTuple::Matrix<long> m_samples; 
  NTuple::Item<long>  m_Nsamples;
  //NTuple::Array<long>* m_samples;
  //int m_NSamples;
  
  class SortDigits
    {
     public:
      SortDigits(const LArOnlineID* onlineHelper);
      inline bool operator()(LArDigit* a, LArDigit* b);
     private:
      const LArOnlineID* m_onlineHelper;
    };
};


inline bool  ReadTBLArDigits::SortDigits::operator()(LArDigit* a, LArDigit* b)
{const HWIdentifier chid_a=a->channelID();
 const HWIdentifier chid_b=b->channelID();
 if (m_onlineHelper->feb_Id(chid_a).get_compact() == m_onlineHelper->feb_Id(chid_b).get_compact())
   return (m_onlineHelper->channel(chid_a) <  m_onlineHelper->channel(chid_b));
 else
   return (m_onlineHelper->feb_Id(chid_a).get_compact() < m_onlineHelper->feb_Id(chid_b).get_compact());
}


#endif

CERN Central CVS service
ViewVC Help
Powered by ViewVC 1.0.9