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

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

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


Revision 1.1 - (download) (annotate)
Mon Nov 22 17:00:27 2004 UTC (8 years, 5 months ago) by rmcphers
Branch: MAIN
CVS Tags: TBCnv-00-02-44
H6 calibration run decoding added
//Dear emacs, this is -*- c++ -*-

#ifndef READLARCALIBDIGITS_H
#define READLARCALIBDIGITS_H
#include "GaudiKernel/Algorithm.h"
#include "GaudiKernel/MsgStream.h"
#include  "StoreGate/StoreGateSvc.h"
#include "TBEvent/TBLArCalibDigitContainer.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 ReadTBLArCalibDigits : public Algorithm
{
 public:
  ReadTBLArCalibDigits(const std::string & name, ISvcLocator * pSvcLocator);

  ~ReadTBLArCalibDigits();

  //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  ReadTBLArCalibDigits::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