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  void setEvent(edm::Event const& e) const {evt = &e;}
42 
43  void write(edm::Event &e) const;
44 
45  void setHandles(const EcalUnpackerWorkerRecord & iRecord);
46  void set(const edm::EventSetup & es) const;
47 
48  unsigned int maxElementIndex() const { return EcalRegionCabling::maxElementIndex();}
49 
50  private:
51 
52  // This is bad design. EventSetup data types and Event product types
53  // should not contain a pointer to the Event. The Event object has a
54  // lifetime of one module and a pointer to it should not be saved in
55  // these types. This is very fragile. This code needs to be redesigned
56  // to remove this pointer entirely.
57  mutable const edm::Event * evt;
58 
60 
62  mutable std::auto_ptr<EBDigiCollection> productDigisEB;
63  mutable std::auto_ptr<EEDigiCollection> productDigisEE;
64 
66  mutable std::auto_ptr<EcalRawDataCollection> productDccHeaders;
67  mutable std::auto_ptr< EBDetIdCollection> productInvalidGains;
68  mutable std::auto_ptr< EBDetIdCollection> productInvalidGainsSwitch;
69  mutable std::auto_ptr< EBDetIdCollection> productInvalidChIds;
70  mutable std::auto_ptr< EEDetIdCollection> productInvalidEEGains;
71  mutable std::auto_ptr<EEDetIdCollection> productInvalidEEGainsSwitch;
72  mutable std::auto_ptr<EEDetIdCollection> productInvalidEEChIds;
73  mutable std::auto_ptr<EBSrFlagCollection> productEBSrFlags;
74  mutable std::auto_ptr<EESrFlagCollection> productEESrFlags;
75  mutable std::auto_ptr<EcalTrigPrimDigiCollection> productTps;
76  mutable std::auto_ptr<EcalPSInputDigiCollection> productPSs;
77  mutable std::auto_ptr<EcalElectronicsIdCollection> productInvalidTTIds;
78  mutable std::auto_ptr<EcalElectronicsIdCollection> productInvalidZSXtalIds;
79  mutable std::auto_ptr<EcalElectronicsIdCollection> productInvalidBlockLengths;
80  mutable std::auto_ptr<EcalPnDiodeDigiCollection> productPnDiodeDigis;
81  mutable std::auto_ptr<EcalElectronicsIdCollection> productInvalidMemTtIds;
82  mutable std::auto_ptr<EcalElectronicsIdCollection> productInvalidMemBlockSizes;
83  mutable std::auto_ptr<EcalElectronicsIdCollection> productInvalidMemChIds;
84  mutable std::auto_ptr<EcalElectronicsIdCollection> productInvalidMemGains;
85 
87 
90 
91  public:
92 
93  template <class DID> void work(EcalDigiCollection::const_iterator & beginDigi,
95  std::auto_ptr<EcalUncalibratedRecHitCollection> & uncalibRecHits,
96  std::auto_ptr< EcalRecHitCollection > & calibRechits)const{
97 // MyWatcher watcher("<Worker>");
98  LogDebug("EcalRawToRecHit|Worker")<<"ready to work on digis.";
99 //<<watcher.lap();
100 
101  EcalDigiCollection::const_iterator itdg = beginDigi;
102  /*R*/ LogDebug("EcalRawToRecHit|Worker")<<"iterator check." ;
103 
104  for(; itdg != endDigi; ++itdg)
105  {
106 
107  //get the uncalibrated rechit
108  /*R*/ LogDebug("EcalRawToRecHit|Worker")<<"ready to make Uncalib rechit." ;
109 //<<watcher.lap();
110  if (!UncalibWorker_->run(*evt, itdg, *uncalibRecHits)) continue;
111  EcalUncalibratedRecHit & EURH=uncalibRecHits->back();
112 
113  /*R*/ LogDebug("EcalRawToRecHit|Worker")<<"creating a rechit." ;
114 //<<watcher.lap();
115  if (!CalibWorker_->run(*evt, EURH, *calibRechits)) continue;
116  /*R*/ LogDebug("EcalRawToRecHit|Worker")<<"created." ;
117 //<<watcher.lap();
118 
119  }//loop over digis
120  }
121 
122 };
123 
124 
125 #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 setEvent(edm::Event const &e) const
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