CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
EcalUnpackerWorker.h
Go to the documentation of this file.
1 #ifndef EcalUnpackerWorker_H
2 #define EcalUnpackerWorker_H
3 
13 
16 
19 
21 
22 //#include "EventFilter/EcalRawToDigi/interface/MyWatcher.h"
23 
25 
26 //forward declaration. just to be friend
28 
30  public:
31 
33 
35 
36  // the method that does it all
37  std::auto_ptr<EcalRecHitCollection> work(const uint32_t & i, const FEDRawDataCollection&) const;
38 
39  // method to set things up once per event
40  void update(const edm::Event & e) const;
41 
42  void write(edm::Event &e) const;
43 
44  void setHandles(const EcalUnpackerWorkerRecord & iRecord);
45  void set(const edm::EventSetup & es) const;
46 
47  unsigned int maxElementIndex() const { return EcalRegionCabling::maxElementIndex();}
48 
49  private:
50 
51  mutable const edm::Event * evt;
52 
54 
56  mutable std::auto_ptr<EBDigiCollection> productDigisEB;
57  mutable std::auto_ptr<EEDigiCollection> productDigisEE;
58 
60  mutable std::auto_ptr<EcalRawDataCollection> productDccHeaders;
61  mutable std::auto_ptr< EBDetIdCollection> productInvalidGains;
62  mutable std::auto_ptr< EBDetIdCollection> productInvalidGainsSwitch;
63  mutable std::auto_ptr< EBDetIdCollection> productInvalidChIds;
64  mutable std::auto_ptr< EEDetIdCollection> productInvalidEEGains;
65  mutable std::auto_ptr<EEDetIdCollection> productInvalidEEGainsSwitch;
66  mutable std::auto_ptr<EEDetIdCollection> productInvalidEEChIds;
67  mutable std::auto_ptr<EBSrFlagCollection> productEBSrFlags;
68  mutable std::auto_ptr<EESrFlagCollection> productEESrFlags;
69  mutable std::auto_ptr<EcalTrigPrimDigiCollection> productTps;
70  mutable std::auto_ptr<EcalPSInputDigiCollection> productPSs;
71  mutable std::auto_ptr<EcalElectronicsIdCollection> productInvalidTTIds;
72  mutable std::auto_ptr<EcalElectronicsIdCollection> productInvalidZSXtalIds;
73  mutable std::auto_ptr<EcalElectronicsIdCollection> productInvalidBlockLengths;
74  mutable std::auto_ptr<EcalPnDiodeDigiCollection> productPnDiodeDigis;
75  mutable std::auto_ptr<EcalElectronicsIdCollection> productInvalidMemTtIds;
76  mutable std::auto_ptr<EcalElectronicsIdCollection> productInvalidMemBlockSizes;
77  mutable std::auto_ptr<EcalElectronicsIdCollection> productInvalidMemChIds;
78  mutable std::auto_ptr<EcalElectronicsIdCollection> productInvalidMemGains;
79 
81 
84 
85  public:
86 
87  template <class DID> void work(EcalDigiCollection::const_iterator & beginDigi,
89  std::auto_ptr<EcalUncalibratedRecHitCollection> & uncalibRecHits,
90  std::auto_ptr< EcalRecHitCollection > & calibRechits)const{
91 // MyWatcher watcher("<Worker>");
92  LogDebug("EcalRawToRecHit|Worker")<<"ready to work on digis.";
93 //<<watcher.lap();
94 
95  EcalDigiCollection::const_iterator itdg = beginDigi;
96  /*R*/ LogDebug("EcalRawToRecHit|Worker")<<"iterator check." ;
97 
98  for(; itdg != endDigi; ++itdg)
99  {
100 
101  //get the uncalibrated rechit
102  /*R*/ LogDebug("EcalRawToRecHit|Worker")<<"ready to make Uncalib rechit." ;
103 //<<watcher.lap();
104  if (!UncalibWorker_->run(*evt, itdg, *uncalibRecHits)) continue;
105  EcalUncalibratedRecHit & EURH=uncalibRecHits->back();
106 
107  /*R*/ LogDebug("EcalRawToRecHit|Worker")<<"creating a rechit." ;
108 //<<watcher.lap();
109  if (!CalibWorker_->run(*evt, EURH, *calibRechits)) continue;
110  /*R*/ LogDebug("EcalRawToRecHit|Worker")<<"created." ;
111 //<<watcher.lap();
112 
113  }//loop over digis
114  }
115 
116 };
117 
118 
119 #endif
#define LogDebug(id)
std::auto_ptr< EcalRecHitCollection > work(const uint32_t &i, const FEDRawDataCollection &) const
int i
Definition: DBlmapReader.cc:9
std::auto_ptr< EEDetIdCollection > productInvalidEEGainsSwitch
EcalRecHitWorkerBaseClass * CalibWorker_
std::auto_ptr< EcalTrigPrimDigiCollection > productTps
std::auto_ptr< EcalPSInputDigiCollection > productPSs
std::auto_ptr< EcalElectronicsIdCollection > productInvalidBlockLengths
std::auto_ptr< EcalPnDiodeDigiCollection > productPnDiodeDigis
boost::transform_iterator< IterHelp, boost::counting_iterator< int > > const_iterator
DCCDataUnpacker * unpacker_
std::auto_ptr< EEDetIdCollection > productInvalidEEGains
EcalUncalibRecHitWorkerBaseClass * UncalibWorker_
std::auto_ptr< EBSrFlagCollection > productEBSrFlags
std::auto_ptr< EESrFlagCollection > productEESrFlags
std::auto_ptr< EBDetIdCollection > productInvalidChIds
std::auto_ptr< EEDigiCollection > productDigisEE
std::auto_ptr< EcalElectronicsIdCollection > productInvalidMemTtIds
void work(EcalDigiCollection::const_iterator &beginDigi, EcalDigiCollection::const_iterator &endDigi, std::auto_ptr< EcalUncalibratedRecHitCollection > &uncalibRecHits, std::auto_ptr< EcalRecHitCollection > &calibRechits) const
void update(const edm::Event &e) const
tuple conf
Definition: dbtoconf.py:185
std::auto_ptr< EBDetIdCollection > productInvalidGainsSwitch
std::auto_ptr< EBDigiCollection > productDigisEB
std::auto_ptr< EBDetIdCollection > productInvalidGains
virtual bool run(const edm::Event &evt, const EcalUncalibratedRecHit &uncalibRH, EcalRecHitCollection &result)=0
void write(edm::Event &e) const
void setHandles(const EcalUnpackerWorkerRecord &iRecord)
static uint32_t maxElementIndex()
EcalElectronicsMapper * myMap_
virtual bool run(const edm::Event &evt, const EcalDigiCollection::const_iterator &digi, EcalUncalibratedRecHitCollection &result)=0
EcalUnpackerWorker(const edm::ParameterSet &conf)
std::auto_ptr< EcalElectronicsIdCollection > productInvalidMemBlockSizes
edm::ESHandle< EcalRegionCabling > cabling
std::auto_ptr< EEDetIdCollection > productInvalidEEChIds
std::auto_ptr< EcalElectronicsIdCollection > productInvalidMemGains
std::auto_ptr< EcalElectronicsIdCollection > productInvalidTTIds
const edm::Event * evt
std::auto_ptr< EcalElectronicsIdCollection > productInvalidMemChIds
std::auto_ptr< EcalElectronicsIdCollection > productInvalidZSXtalIds
void set(const edm::EventSetup &es) const
std::auto_ptr< EcalRawDataCollection > productDccHeaders
unsigned int maxElementIndex() const