CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
List of all members | Public Member Functions | Public Attributes | Private Attributes
EcalRawToDigi Class Reference

#include <EcalRawToDigi.h>

Inheritance diagram for EcalRawToDigi:
edm::stream::EDProducer<> edm::stream::EDProducerBase edm::ProducerBase edm::EDConsumerBase edm::ProductRegistryHelper

Public Member Functions

virtual void beginRun (const edm::Run &run, const edm::EventSetup &es) override
 
 EcalRawToDigi (const edm::ParameterSet &ps)
 
virtual void produce (edm::Event &e, const edm::EventSetup &c) override
 
virtual ~EcalRawToDigi ()
 
- Public Member Functions inherited from edm::stream::EDProducer<>
 EDProducer ()=default
 
- Public Member Functions inherited from edm::stream::EDProducerBase
 EDProducerBase ()
 
ModuleDescription const & moduleDescription () const
 
virtual ~EDProducerBase ()
 
- Public Member Functions inherited from edm::ProducerBase
 ProducerBase ()
 
void registerProducts (ProducerBase *, ProductRegistry *, ModuleDescription const &)
 
std::function< void(BranchDescription
const &)> 
registrationCallback () const
 used by the fwk to register list of products More...
 
virtual ~ProducerBase ()
 
- Public Member Functions inherited from edm::EDConsumerBase
 EDConsumerBase ()
 
ProductHolderIndexAndSkipBit indexFrom (EDGetToken, BranchType, TypeID const &) const
 
void itemsMayGet (BranchType, std::vector< ProductHolderIndexAndSkipBit > &) const
 
void itemsToGet (BranchType, std::vector< ProductHolderIndexAndSkipBit > &) const
 
std::vector
< ProductHolderIndexAndSkipBit >
const & 
itemsToGetFromEvent () const
 
void labelsForToken (EDGetToken iToken, Labels &oLabels) const
 
void modulesDependentUpon (const std::string &iProcessName, std::vector< const char * > &oModuleLabels) const
 
bool registeredToConsume (ProductHolderIndex, bool, BranchType) const
 
bool registeredToConsumeMany (TypeID const &, BranchType) const
 
void updateLookup (BranchType iBranchType, ProductHolderIndexHelper const &)
 
virtual ~EDConsumerBase ()
 

Public Attributes

edm::ESWatcher< EcalMappingRcdwatcher_
 

Private Attributes

edm::EDGetTokenT
< FEDRawDataCollection
dataToken_
 
edm::EDGetTokenT< EcalListOfFEDSfedsToken_
 
std::vector< int > fedUnpackList_
 
bool feIdCheck_
 
bool feUnpacking_
 
bool first_
 
bool forceToKeepFRdata_
 
bool headerUnpacking_
 
bool memUnpacking_
 
EcalElectronicsMappermyMap_
 
unsigned int nevts_
 
unsigned int numbTriggerTSamples_
 
unsigned int numbXtalTSamples_
 
std::vector< int > orderedDCCIdList_
 
std::vector< int > orderedFedUnpackList_
 
bool put_
 
bool REGIONAL_
 
double RUNNING_TIME_
 
double SETUP_TIME_
 
bool srpUnpacking_
 
bool syncCheck_
 
bool tccUnpacking_
 
DCCDataUnpackertheUnpacker_
 

Additional Inherited Members

- Public Types inherited from edm::stream::EDProducer<>
typedef CacheContexts< T...> CacheTypes
 
typedef CacheTypes::GlobalCache GlobalCache
 
typedef AbilityChecker< T...> HasAbility
 
typedef
CacheTypes::LuminosityBlockCache 
LuminosityBlockCache
 
typedef
LuminosityBlockContextT
< LuminosityBlockCache,
RunCache, GlobalCache
LuminosityBlockContext
 
typedef
CacheTypes::LuminosityBlockSummaryCache 
LuminosityBlockSummaryCache
 
typedef CacheTypes::RunCache RunCache
 
typedef RunContextT< RunCache,
GlobalCache
RunContext
 
typedef CacheTypes::RunSummaryCache RunSummaryCache
 
- Public Types inherited from edm::stream::EDProducerBase
typedef EDProducerAdaptorBase ModuleType
 
- Public Types inherited from edm::ProducerBase
typedef
ProductRegistryHelper::TypeLabelList 
TypeLabelList
 
- Static Public Member Functions inherited from edm::stream::EDProducerBase
static const std::string & baseType ()
 
static void fillDescriptions (ConfigurationDescriptions &descriptions)
 
static void prevalidate (ConfigurationDescriptions &descriptions)
 
- Protected Member Functions inherited from edm::ProducerBase
void callWhenNewProductsRegistered (std::function< void(BranchDescription const &)> const &func)
 
- Protected Member Functions inherited from edm::EDConsumerBase
template<typename ProductType , BranchType B = InEvent>
EDGetTokenT< ProductType > consumes (edm::InputTag const &tag)
 
EDGetToken consumes (const TypeToGet &id, edm::InputTag const &tag)
 
template<BranchType B>
EDGetToken consumes (TypeToGet const &id, edm::InputTag const &tag)
 
ConsumesCollector consumesCollector ()
 Use a ConsumesCollector to gather consumes information from helper functions. More...
 
template<typename ProductType , BranchType B = InEvent>
void consumesMany ()
 
void consumesMany (const TypeToGet &id)
 
template<BranchType B>
void consumesMany (const TypeToGet &id)
 
template<typename ProductType , BranchType B = InEvent>
EDGetTokenT< ProductType > mayConsume (edm::InputTag const &tag)
 
EDGetToken mayConsume (const TypeToGet &id, edm::InputTag const &tag)
 
template<BranchType B>
EDGetToken mayConsume (const TypeToGet &id, edm::InputTag const &tag)
 

Detailed Description

Definition at line 41 of file EcalRawToDigi.h.

Constructor & Destructor Documentation

EcalRawToDigi::EcalRawToDigi ( const edm::ParameterSet ps)
explicit

Class constructor

Definition at line 13 of file EcalRawToDigi.cc.

References dataToken_, fedsToken_, fedUnpackList_, feIdCheck_, feUnpacking_, first_, forceToKeepFRdata_, edm::ParameterSet::getParameter(), edm::ParameterSet::getUntrackedParameter(), headerUnpacking_, i, LogDebug, EcalElectronicsMapper::makeMapFromVectors(), FEDNumbering::MAXECALFEDID, memUnpacking_, FEDNumbering::MINECALFEDID, myMap_, numbTriggerTSamples_, numbXtalTSamples_, orderedDCCIdList_, orderedFedUnpackList_, convertSQLitetoXML_cfg::output, REGIONAL_, DCCDataUnpacker::silentMode_, srpUnpacking_, syncCheck_, tccUnpacking_, and theUnpacker_.

13  :
14 
15  //define the list of FED to be unpacked
16  fedUnpackList_(conf.getParameter<std::vector<int> >("FEDs")),
17 
18  //define the ordered FED list
19  orderedFedUnpackList_(conf.getParameter<std::vector<int> >("orderedFedList")),
20 
21  //define the ordered DCCId list
22  orderedDCCIdList_(conf.getParameter<std::vector<int> >("orderedDCCIdList")),
23 
24  //get number of Xtal Time Samples
25  numbXtalTSamples_(conf.getParameter<int>("numbXtalTSamples")),
26 
27  //Get number of Trigger Time Samples
28  numbTriggerTSamples_(conf.getParameter<int>("numbTriggerTSamples")),
29 
30  //See if header unpacking is enabled
31  headerUnpacking_(conf.getParameter<bool>("headerUnpacking")),
32 
33  //See if srp unpacking is enabled
34  srpUnpacking_(conf.getParameter<bool>("srpUnpacking")),
35 
36  //See if tcc unpacking is enabled
37  tccUnpacking_(conf.getParameter<bool>("tccUnpacking")),
38 
39  //See if fe unpacking is enabled
40  feUnpacking_(conf.getParameter<bool>("feUnpacking")),
41 
42  //See if fe unpacking is enabled for mem box
43  memUnpacking_(conf.getParameter<bool>("memUnpacking")),
44 
45  //See if syncCheck is enabled
46  syncCheck_(conf.getParameter<bool>("syncCheck")),
47 
48  //See if feIdCheck is enabled
49  feIdCheck_(conf.getParameter<bool>("feIdCheck")),
50 
51  // See if we want to keep data even if we have a mismatch between SR decision and block length
52  forceToKeepFRdata_(conf.getParameter<bool>("forceToKeepFRData")),
53 
54 
55  put_(conf.getParameter<bool>("eventPut")),
56 
57 
58 
59  REGIONAL_(conf.getParameter<bool>("DoRegional")),
60 
61 
62 
63  myMap_(0),
64 
65  theUnpacker_(0)
66 
67 {
68 
69  first_ = true;
70  DCCDataUnpacker::silentMode_ = conf.getUntrackedParameter<bool>("silentMode",false) ;
71 
72  if( numbXtalTSamples_ <6 || numbXtalTSamples_>64 || (numbXtalTSamples_-2)%4 ){
73  std::ostringstream output;
74  output <<"\n Unsuported number of xtal time samples : "<<numbXtalTSamples_
75  <<"\n Valid Number of xtal time samples are : 6,10,14,18,...,62";
76  edm::LogError("IncorrectConfiguration")<< output.str();
77  // todo : throw an execption
78  }
79 
81  std::ostringstream output;
82  output <<"\n Unsuported number of trigger time samples : "<<numbTriggerTSamples_
83  <<"\n Valid number of trigger time samples are : 1, 4 or 8";
84  edm::LogError("IncorrectConfiguration")<< output.str();
85  // todo : throw an execption
86  }
87 
88  //NA : testing
89  //nevts_=0;
90  //RUNNING_TIME_=0;
91 
92  // if there are FEDs specified to unpack fill the vector of the fedUnpackList_
93  // else fill with the entire ECAL fed range (600-670)
94  if (fedUnpackList_.empty())
96  fedUnpackList_.push_back(i);
97 
98  //print the FEDs to unpack to the logger
99  std::ostringstream loggerOutput_;
100  if(fedUnpackList_.size()!=0){
101  for (unsigned int i=0; i<fedUnpackList_.size(); i++)
102  loggerOutput_ << fedUnpackList_[i] << " ";
103  edm::LogInfo("EcalRawToDigi") << "EcalRawToDigi will unpack FEDs ( " << loggerOutput_.str() << ")";
104  LogDebug("EcalRawToDigi") << "EcalRawToDigi will unpack FEDs ( " << loggerOutput_.str() << ")";
105  }
106 
107  edm::LogInfo("EcalRawToDigi")
108  <<"\n ECAL RawToDigi configuration:"
109  <<"\n Header unpacking is "<<headerUnpacking_
110  <<"\n SRP Bl. unpacking is "<<srpUnpacking_
111  <<"\n TCC Bl. unpacking is "<<tccUnpacking_
112  <<"\n FE Bl. unpacking is "<<feUnpacking_
113  <<"\n MEM Bl. unpacking is "<<memUnpacking_
114  <<"\n sync check is "<<syncCheck_
115  <<"\n feID check is "<<feIdCheck_
116  <<"\n force keep FR data is "<<forceToKeepFRdata_
117  <<"\n";
118 
119  edm::InputTag dataLabel = conf.getParameter<edm::InputTag>("InputLabel");
120  edm::InputTag fedsLabel = conf.getParameter<edm::InputTag>("FedLabel");
121 
122  // Producer products :
123  produces<EBDigiCollection>("ebDigis");
124  produces<EEDigiCollection>("eeDigis");
125  produces<EBSrFlagCollection>();
126  produces<EESrFlagCollection>();
127  produces<EcalRawDataCollection>();
128  produces<EcalPnDiodeDigiCollection>();
129  produces<EcalTrigPrimDigiCollection>("EcalTriggerPrimitives");
130  produces<EcalPSInputDigiCollection>("EcalPseudoStripInputs");
131 
132  // Integrity for xtal data
133  produces<EBDetIdCollection>("EcalIntegrityGainErrors");
134  produces<EBDetIdCollection>("EcalIntegrityGainSwitchErrors");
135  produces<EBDetIdCollection>("EcalIntegrityChIdErrors");
136 
137  // Integrity for xtal data - EE specific (to be rivisited towards EB+EE common collection)
138  produces<EEDetIdCollection>("EcalIntegrityGainErrors");
139  produces<EEDetIdCollection>("EcalIntegrityGainSwitchErrors");
140  produces<EEDetIdCollection>("EcalIntegrityChIdErrors");
141 
142  // Integrity Errors
143  produces<EcalElectronicsIdCollection>("EcalIntegrityTTIdErrors");
144  produces<EcalElectronicsIdCollection>("EcalIntegrityZSXtalIdErrors");
145  produces<EcalElectronicsIdCollection>("EcalIntegrityBlockSizeErrors");
146 
147  // Mem channels' integrity
148  produces<EcalElectronicsIdCollection>("EcalIntegrityMemTtIdErrors");
149  produces<EcalElectronicsIdCollection>("EcalIntegrityMemBlockSizeErrors");
150  produces<EcalElectronicsIdCollection>("EcalIntegrityMemChIdErrors");
151  produces<EcalElectronicsIdCollection>("EcalIntegrityMemGainErrors");
152 
153  dataToken_=consumes<FEDRawDataCollection>(dataLabel);
154  if (REGIONAL_){
155  fedsToken_=consumes<EcalListOfFEDS>(fedsLabel);
156  }
157 
158  // Build a new Electronics mapper and parse default map file
159  myMap_ = new EcalElectronicsMapper(numbXtalTSamples_,numbTriggerTSamples_);
160 
161  // in case of external tsext file (deprecated by HLT environment)
162  // bool readResult = myMap_->readDCCMapFile(conf.getParameter<std::string>("DCCMapFile",""));
163 
164  // use two arrays from cfg to establish DCCId:FedId. If they are empy, than use hard coded correspondence
166  // myMap::makeMapFromVectors() returns "true" always
167  // need to be fixed?
168 
169  if(!readResult){
170  edm::LogWarning("IncorrectConfiguration")
171  << "Arrays orderedFedList and orderedDCCIdList are emply. "
172  "Hard coded correspondence for DCCId:FedId will be used.";
173  // edm::LogError("EcalRawToDigi")<<"\n unable to read file : "
174  // <<conf.getParameter<std::string>("DCCMapFile");
175  }
176 
177  // Build a new ECAL DCC data unpacker
179 
180 }
#define LogDebug(id)
int i
Definition: DBlmapReader.cc:9
unsigned int numbXtalTSamples_
Definition: EcalRawToDigi.h:74
bool forceToKeepFRdata_
Definition: EcalRawToDigi.h:84
edm::EDGetTokenT< FEDRawDataCollection > dataToken_
Definition: EcalRawToDigi.h:89
std::vector< int > orderedFedUnpackList_
Definition: EcalRawToDigi.h:71
std::vector< int > fedUnpackList_
Definition: EcalRawToDigi.h:69
DCCDataUnpacker * theUnpacker_
static std::atomic< bool > silentMode_
unsigned int numbTriggerTSamples_
Definition: EcalRawToDigi.h:75
bool makeMapFromVectors(std::vector< int > &, std::vector< int > &)
std::vector< int > orderedDCCIdList_
Definition: EcalRawToDigi.h:72
edm::EDGetTokenT< EcalListOfFEDS > fedsToken_
Definition: EcalRawToDigi.h:90
tuple conf
Definition: dbtoconf.py:185
bool headerUnpacking_
Definition: EcalRawToDigi.h:77
EcalElectronicsMapper * myMap_
Definition: EcalRawToDigi.h:97
EcalRawToDigi::~EcalRawToDigi ( )
virtual

Class destructor

Definition at line 481 of file EcalRawToDigi.cc.

References myMap_, and theUnpacker_.

482 {
483 
484  //cout << "EcalDCCUnpackingModule " << "N events " << (nevts_-1)<<endl;
485  //cout << "EcalDCCUnpackingModule " << " --- SETUP time " << endl;
486  //cout << "EcalDCCUnpackingModule " << "Time (sys) " << SETUP_TIME_ << endl;
487  //cout << "EcalDCCUnpackingModule " << "Time in sec. " << SETUP_TIME_/ CLOCKS_PER_SEC << endl;
488  //cout << "EcalDCCUnpackingModule " << " --- Per event " << endl;
489 
490  //RUNNING_TIME_ = RUNNING_TIME_ / (nevts_-1);
491 
492  //cout << "EcalDCCUnpackingModule "<< "Time (sys) " << RUNNING_TIME_ << endl;
493  //cout << "EcalDCCUnpackingModule "<< "Time in sec. " << RUNNING_TIME_ / CLOCKS_PER_SEC << endl;
494 
495 
496 
497  if(myMap_ ) delete myMap_;
498  if(theUnpacker_) delete theUnpacker_;
499 
500 }
DCCDataUnpacker * theUnpacker_
EcalElectronicsMapper * myMap_
Definition: EcalRawToDigi.h:97

Member Function Documentation

void EcalRawToDigi::beginRun ( const edm::Run run,
const edm::EventSetup es 
)
overridevirtual

Reimplemented from edm::stream::EDProducerBase.

Definition at line 238 of file EcalRawToDigi.cc.

References edm::EventSetup::get(), edm::ESHandle< class >::product(), DCCDataUnpacker::setChannelStatusDB(), and theUnpacker_.

239 {
240  // channel status database
242  es.get<EcalChannelStatusRcd>().get(pChStatus);
244 
245  // uncomment following line to print list of crystals with bad status
246  //edm::ESHandle<EcalElectronicsMapping> pEcalMapping;
247  //es.get<EcalMappingRcd>().get(pEcalMapping);
248  //const EcalElectronicsMapping* mapping = pEcalMapping.product();
249  //printStatusRecords(theUnpacker_, mapping);
250 }
void setChannelStatusDB(const EcalChannelStatusMap *chdb)
DCCDataUnpacker * theUnpacker_
const T & get() const
Definition: EventSetup.h:55
T const * product() const
Definition: ESHandle.h:62
void EcalRawToDigi::produce ( edm::Event e,
const edm::EventSetup c 
)
overridevirtual

Functions that are called by framework at each event

Implements edm::stream::EDProducerBase.

Definition at line 253 of file EcalRawToDigi.cc.

References edm::ESWatcher< T >::check(), FEDRawData::data(), data, dataToken_, EMPTYEVENTSIZE, fedsToken_, fedUnpackList_, feUnpacking_, spr::find(), first_, edm::EventSetup::get(), EcalElectronicsMapper::getActiveSM(), edm::Event::getByToken(), headerUnpacking_, i, LogDebug, memUnpacking_, myMap_, edm::ESHandle< class >::product(), edm::Event::put(), put_, lumiPlot::rawdata, REGIONAL_, EcalElectronicsMapper::setActiveDCC(), DCCDataUnpacker::setDccHeadersCollection(), DCCDataUnpacker::setEBDigisCollection(), DCCDataUnpacker::setEBSrFlagsCollection(), DCCDataUnpacker::setEcalPSsCollection(), DCCDataUnpacker::setEcalTpsCollection(), DCCDataUnpacker::setEEDigisCollection(), DCCDataUnpacker::setEESrFlagsCollection(), DCCDataUnpacker::setInvalidBlockLengthsCollection(), DCCDataUnpacker::setInvalidChIdsCollection(), DCCDataUnpacker::setInvalidEEChIdsCollection(), DCCDataUnpacker::setInvalidEEGainsCollection(), DCCDataUnpacker::setInvalidEEGainsSwitchCollection(), DCCDataUnpacker::setInvalidGainsCollection(), DCCDataUnpacker::setInvalidGainsSwitchCollection(), DCCDataUnpacker::setInvalidMemBlockSizesCollection(), DCCDataUnpacker::setInvalidMemChIdsCollection(), DCCDataUnpacker::setInvalidMemGainsCollection(), DCCDataUnpacker::setInvalidMemTtIdsCollection(), DCCDataUnpacker::setInvalidTTIdsCollection(), DCCDataUnpacker::setInvalidZSXtalIdsCollection(), DCCDataUnpacker::setPnDiodeDigisCollection(), FEDRawData::size(), srpUnpacking_, tccUnpacking_, theUnpacker_, DCCDataUnpacker::unpack(), and watcher_.

Referenced by JSONExport.JsonExport::export(), HTMLExport.HTMLExport::export(), and HTMLExport.HTMLExportStatic::export().

254 {
255 
256  //double TIME_START = clock();
257  //nevts_++; //NUNO
258 
259 
260  if (first_) {
261  watcher_.check(es);
263  es.get< EcalMappingRcd >().get(ecalmapping);
264  myMap_ -> setEcalElectronicsMapping(ecalmapping.product());
265 
266  first_ = false;
267 
268  }else{
269 
270  if ( watcher_.check(es) ) {
272  es.get< EcalMappingRcd >().get(ecalmapping);
273  myMap_ -> deletePointers();
274  myMap_ -> resetPointers();
275  myMap_ -> setEcalElectronicsMapping(ecalmapping.product());
276  }
277 
278  }
279 
280  // Get list of FEDS :
281  std::vector<int> FEDS_to_unpack;
282  if (REGIONAL_) {
283  edm::Handle<EcalListOfFEDS> listoffeds;
284  e.getByToken(fedsToken_, listoffeds);
285  FEDS_to_unpack = listoffeds -> GetList();
286  }
287 
288 
289 
290  // Step A: Get Inputs
291 
293  e.getByToken(dataToken_,rawdata);
294 
295 
296  // Step B: encapsulate vectors in actual collections and set unpacker pointers
297 
298  // create the collection of Ecal Digis
299  std::auto_ptr<EBDigiCollection> productDigisEB(new EBDigiCollection);
300  productDigisEB->reserve(1700);
301  theUnpacker_->setEBDigisCollection(&productDigisEB);
302 
303  // create the collection of Ecal Digis
304  std::auto_ptr<EEDigiCollection> productDigisEE(new EEDigiCollection);
305  theUnpacker_->setEEDigisCollection(&productDigisEE);
306 
307  // create the collection for headers
308  std::auto_ptr<EcalRawDataCollection> productDccHeaders(new EcalRawDataCollection);
309  theUnpacker_->setDccHeadersCollection(&productDccHeaders);
310 
311  // create the collection for invalid gains
312  std::auto_ptr< EBDetIdCollection> productInvalidGains(new EBDetIdCollection);
313  theUnpacker_->setInvalidGainsCollection(&productInvalidGains);
314 
315  // create the collection for invalid gain Switch
316  std::auto_ptr< EBDetIdCollection> productInvalidGainsSwitch(new EBDetIdCollection);
317  theUnpacker_->setInvalidGainsSwitchCollection(&productInvalidGainsSwitch);
318 
319  // create the collection for invalid chids
320  std::auto_ptr< EBDetIdCollection> productInvalidChIds(new EBDetIdCollection);
321  theUnpacker_->setInvalidChIdsCollection(&productInvalidChIds);
322 
324 
325  // create the collection for invalid gains
326  std::auto_ptr<EEDetIdCollection> productInvalidEEGains(new EEDetIdCollection);
327  theUnpacker_->setInvalidEEGainsCollection(&productInvalidEEGains);
328 
329  // create the collection for invalid gain Switch
330  std::auto_ptr<EEDetIdCollection> productInvalidEEGainsSwitch(new EEDetIdCollection);
331  theUnpacker_->setInvalidEEGainsSwitchCollection(&productInvalidEEGainsSwitch);
332 
333  // create the collection for invalid chids
334  std::auto_ptr<EEDetIdCollection> productInvalidEEChIds(new EEDetIdCollection);
335  theUnpacker_->setInvalidEEChIdsCollection(&productInvalidEEChIds);
336 
338 
339  // create the collection for EB srflags
340  std::auto_ptr<EBSrFlagCollection> productEBSrFlags(new EBSrFlagCollection);
341  theUnpacker_->setEBSrFlagsCollection(&productEBSrFlags);
342 
343  // create the collection for EB srflags
344  std::auto_ptr<EESrFlagCollection> productEESrFlags(new EESrFlagCollection);
345  theUnpacker_->setEESrFlagsCollection(&productEESrFlags);
346 
347  // create the collection for ecal trigger primitives
348  std::auto_ptr<EcalTrigPrimDigiCollection> productEcalTps(new EcalTrigPrimDigiCollection);
349  theUnpacker_->setEcalTpsCollection(&productEcalTps);
351 
352  // create the collection for ecal trigger primitives
353  std::auto_ptr<EcalPSInputDigiCollection> productEcalPSs(new EcalPSInputDigiCollection);
354  theUnpacker_->setEcalPSsCollection(&productEcalPSs);
356 
357  // create the collection for invalid TTIds
358  std::auto_ptr<EcalElectronicsIdCollection> productInvalidTTIds(new EcalElectronicsIdCollection);
359  theUnpacker_->setInvalidTTIdsCollection(&productInvalidTTIds);
360 
361  // create the collection for invalid TTIds
362  std::auto_ptr<EcalElectronicsIdCollection> productInvalidZSXtalIds(new EcalElectronicsIdCollection);
363  theUnpacker_->setInvalidZSXtalIdsCollection(&productInvalidZSXtalIds);
364 
365 
366 
367  // create the collection for invalid BlockLengths
368  std::auto_ptr<EcalElectronicsIdCollection> productInvalidBlockLengths(new EcalElectronicsIdCollection);
369  theUnpacker_->setInvalidBlockLengthsCollection(&productInvalidBlockLengths);
370 
371  // MEMs Collections
372  // create the collection for the Pn Diode Digis
373  std::auto_ptr<EcalPnDiodeDigiCollection> productPnDiodeDigis(new EcalPnDiodeDigiCollection);
374  theUnpacker_->setPnDiodeDigisCollection(&productPnDiodeDigis);
375 
376  // create the collection for invalid Mem Tt id
377  std::auto_ptr<EcalElectronicsIdCollection> productInvalidMemTtIds(new EcalElectronicsIdCollection);
378  theUnpacker_->setInvalidMemTtIdsCollection(& productInvalidMemTtIds);
379 
380  // create the collection for invalid Mem Block Size
381  std::auto_ptr<EcalElectronicsIdCollection> productInvalidMemBlockSizes(new EcalElectronicsIdCollection);
382  theUnpacker_->setInvalidMemBlockSizesCollection(& productInvalidMemBlockSizes);
383 
384  // create the collection for invalid Mem Block Size
385  std::auto_ptr<EcalElectronicsIdCollection> productInvalidMemChIds(new EcalElectronicsIdCollection);
386  theUnpacker_->setInvalidMemChIdsCollection(& productInvalidMemChIds);
387 
388  // create the collection for invalid Mem Gain Errors
389  std::auto_ptr<EcalElectronicsIdCollection> productInvalidMemGains(new EcalElectronicsIdCollection);
390  theUnpacker_->setInvalidMemGainsCollection(& productInvalidMemGains);
391  // double TIME_START = clock();
392 
393 
394  // Step C: unpack all requested FEDs
395  for (std::vector<int>::const_iterator i=fedUnpackList_.begin(); i!=fedUnpackList_.end(); i++) {
396 
397  if (REGIONAL_) {
398  std::vector<int>::const_iterator fed_it = find(FEDS_to_unpack.begin(), FEDS_to_unpack.end(), *i);
399  if (fed_it == FEDS_to_unpack.end()) continue;
400  }
401 
402 
403  // get fed raw data and SM id
404  const FEDRawData& fedData = rawdata->FEDData(*i);
405  const size_t length = fedData.size();
406 
407  LogDebug("EcalRawToDigi") << "raw data length: " << length ;
408  //if data size is not null interpret data
409  if ( length >= EMPTYEVENTSIZE ){
410 
411  if(myMap_->setActiveDCC(*i)){
412 
413  const int smId = myMap_->getActiveSM();
414  LogDebug("EcalRawToDigi") << "Getting FED = " << *i <<"(SM = "<<smId<<")"<<" data size is: " << length;
415 
416  const uint64_t* data = (uint64_t*) fedData.data();
417  theUnpacker_->unpack(data, length, smId, *i);
418 
419  LogDebug("EcalRawToDigi") <<" in EE :"<<productDigisEE->size()
420  <<" in EB :"<<productDigisEB->size();
421  }
422  }
423 
424  }// loop on FEDs
425 
426  //if(nevts_>1){ //NUNO
427  // double TIME_END = clock(); //NUNO
428  // RUNNING_TIME_ += TIME_END-TIME_START; //NUNO
429  // }
430 
431 
432  // Add collections to the event
433 
434  if(put_){
435 
436  if( headerUnpacking_){
437  e.put(productDccHeaders);
438  }
439 
440  if(feUnpacking_){
441  productDigisEB->sort();
442  e.put(productDigisEB,"ebDigis");
443  productDigisEE->sort();
444  e.put(productDigisEE,"eeDigis");
445  e.put(productInvalidGains,"EcalIntegrityGainErrors");
446  e.put(productInvalidGainsSwitch, "EcalIntegrityGainSwitchErrors");
447  e.put(productInvalidChIds, "EcalIntegrityChIdErrors");
448  // EE (leaving for now the same names as in EB)
449  e.put(productInvalidEEGains,"EcalIntegrityGainErrors");
450  e.put(productInvalidEEGainsSwitch, "EcalIntegrityGainSwitchErrors");
451  e.put(productInvalidEEChIds, "EcalIntegrityChIdErrors");
452  // EE
453  e.put(productInvalidTTIds,"EcalIntegrityTTIdErrors");
454  e.put(productInvalidZSXtalIds,"EcalIntegrityZSXtalIdErrors");
455  e.put(productInvalidBlockLengths,"EcalIntegrityBlockSizeErrors");
456  e.put(productPnDiodeDigis);
457  }
458  if(memUnpacking_){
459  e.put(productInvalidMemTtIds,"EcalIntegrityMemTtIdErrors");
460  e.put(productInvalidMemBlockSizes,"EcalIntegrityMemBlockSizeErrors");
461  e.put(productInvalidMemChIds,"EcalIntegrityMemChIdErrors");
462  e.put(productInvalidMemGains,"EcalIntegrityMemGainErrors");
463  }
464  if(srpUnpacking_){
465  e.put(productEBSrFlags);
466  e.put(productEESrFlags);
467  }
468  if(tccUnpacking_){
469  e.put(productEcalTps,"EcalTriggerPrimitives");
470  e.put(productEcalPSs,"EcalPseudoStripInputs");
471  }
472  }
473 
474 //if(nevts_>1){ //NUNO
475 // double TIME_END = clock(); //NUNO
476 // RUNNING_TIME_ += TIME_END-TIME_START; //NUNO
477 //}
478 
479 }
#define LogDebug(id)
void setPnDiodeDigisCollection(std::auto_ptr< EcalPnDiodeDigiCollection > *x)
edm::ESWatcher< EcalMappingRcd > watcher_
Definition: EcalRawToDigi.h:63
int i
Definition: DBlmapReader.cc:9
void unpack(const uint64_t *buffer, size_t bufferSize, unsigned int smId, unsigned int fedId)
void setInvalidZSXtalIdsCollection(std::auto_ptr< EcalElectronicsIdCollection > *x)
edm::EDGetTokenT< FEDRawDataCollection > dataToken_
Definition: EcalRawToDigi.h:89
bool getByToken(EDGetToken token, Handle< PROD > &result) const
Definition: Event.h:434
void setInvalidMemBlockSizesCollection(std::auto_ptr< EcalElectronicsIdCollection > *x)
void setDccHeadersCollection(std::auto_ptr< EcalRawDataCollection > *x)
void setEcalPSsCollection(std::auto_ptr< EcalPSInputDigiCollection > *x)
void setInvalidEEGainsSwitchCollection(std::auto_ptr< EEDetIdCollection > *x)
void find(edm::Handle< EcalRecHitCollection > &hits, DetId thisDet, std::vector< EcalRecHitCollection::const_iterator > &hit, bool debug=false)
Definition: FindCaloHit.cc:7
void setEEDigisCollection(std::auto_ptr< EEDigiCollection > *x)
size_t size() const
Lenght of the data buffer in bytes.
Definition: FEDRawData.h:47
std::vector< int > fedUnpackList_
Definition: EcalRawToDigi.h:69
DCCDataUnpacker * theUnpacker_
void setInvalidMemTtIdsCollection(std::auto_ptr< EcalElectronicsIdCollection > *x)
void setEBSrFlagsCollection(std::auto_ptr< EBSrFlagCollection > *x)
OrphanHandle< PROD > put(std::auto_ptr< PROD > product)
Put a new product.
Definition: Event.h:116
bool setActiveDCC(unsigned int dccId)
void setEBDigisCollection(std::auto_ptr< EBDigiCollection > *x)
void setInvalidMemGainsCollection(std::auto_ptr< EcalElectronicsIdCollection > *x)
void setInvalidGainsCollection(std::auto_ptr< EBDetIdCollection > *x)
void setInvalidEEChIdsCollection(std::auto_ptr< EEDetIdCollection > *x)
edm::EDGetTokenT< EcalListOfFEDS > fedsToken_
Definition: EcalRawToDigi.h:90
void setInvalidTTIdsCollection(std::auto_ptr< EcalElectronicsIdCollection > *x)
bool headerUnpacking_
Definition: EcalRawToDigi.h:77
void setInvalidGainsSwitchCollection(std::auto_ptr< EBDetIdCollection > *x)
unsigned long long uint64_t
Definition: Time.h:15
void setEESrFlagsCollection(std::auto_ptr< EESrFlagCollection > *x)
T const * product() const
Definition: ESHandle.h:62
bool check(const edm::EventSetup &iSetup)
Definition: ESWatcher.h:58
char data[epos_bytes_allocation]
Definition: EPOS_Wrapper.h:82
const unsigned char * data() const
Return a const pointer to the beginning of the data buffer.
Definition: FEDRawData.cc:28
void setEcalTpsCollection(std::auto_ptr< EcalTrigPrimDigiCollection > *x)
void setInvalidMemChIdsCollection(std::auto_ptr< EcalElectronicsIdCollection > *x)
void setInvalidBlockLengthsCollection(std::auto_ptr< EcalElectronicsIdCollection > *x)
dictionary rawdata
Definition: lumiPlot.py:393
void setInvalidEEGainsCollection(std::auto_ptr< EEDetIdCollection > *x)
EcalElectronicsMapper * myMap_
Definition: EcalRawToDigi.h:97
void setInvalidChIdsCollection(std::auto_ptr< EBDetIdCollection > *x)

Member Data Documentation

edm::EDGetTokenT<FEDRawDataCollection> EcalRawToDigi::dataToken_
private

Definition at line 89 of file EcalRawToDigi.h.

Referenced by EcalRawToDigi(), and produce().

edm::EDGetTokenT<EcalListOfFEDS> EcalRawToDigi::fedsToken_
private

Definition at line 90 of file EcalRawToDigi.h.

Referenced by EcalRawToDigi(), and produce().

std::vector<int> EcalRawToDigi::fedUnpackList_
private

Definition at line 69 of file EcalRawToDigi.h.

Referenced by EcalRawToDigi(), and produce().

bool EcalRawToDigi::feIdCheck_
private

Definition at line 83 of file EcalRawToDigi.h.

Referenced by EcalRawToDigi().

bool EcalRawToDigi::feUnpacking_
private

Definition at line 80 of file EcalRawToDigi.h.

Referenced by EcalRawToDigi(), and produce().

bool EcalRawToDigi::first_
private

Definition at line 85 of file EcalRawToDigi.h.

Referenced by EcalRawToDigi(), and produce().

bool EcalRawToDigi::forceToKeepFRdata_
private

Definition at line 84 of file EcalRawToDigi.h.

Referenced by EcalRawToDigi().

bool EcalRawToDigi::headerUnpacking_
private

Definition at line 77 of file EcalRawToDigi.h.

Referenced by EcalRawToDigi(), and produce().

bool EcalRawToDigi::memUnpacking_
private

Definition at line 81 of file EcalRawToDigi.h.

Referenced by EcalRawToDigi(), and produce().

EcalElectronicsMapper* EcalRawToDigi::myMap_
private

Definition at line 97 of file EcalRawToDigi.h.

Referenced by EcalRawToDigi(), produce(), and ~EcalRawToDigi().

unsigned int EcalRawToDigi::nevts_
private

Definition at line 102 of file EcalRawToDigi.h.

unsigned int EcalRawToDigi::numbTriggerTSamples_
private

Definition at line 75 of file EcalRawToDigi.h.

Referenced by EcalRawToDigi().

unsigned int EcalRawToDigi::numbXtalTSamples_
private

Definition at line 74 of file EcalRawToDigi.h.

Referenced by EcalRawToDigi().

std::vector<int> EcalRawToDigi::orderedDCCIdList_
private

Definition at line 72 of file EcalRawToDigi.h.

Referenced by EcalRawToDigi().

std::vector<int> EcalRawToDigi::orderedFedUnpackList_
private

Definition at line 71 of file EcalRawToDigi.h.

Referenced by EcalRawToDigi().

bool EcalRawToDigi::put_
private

Definition at line 86 of file EcalRawToDigi.h.

Referenced by produce().

bool EcalRawToDigi::REGIONAL_
private

Definition at line 93 of file EcalRawToDigi.h.

Referenced by EcalRawToDigi(), and produce().

double EcalRawToDigi::RUNNING_TIME_
private

Definition at line 103 of file EcalRawToDigi.h.

double EcalRawToDigi::SETUP_TIME_
private

Definition at line 103 of file EcalRawToDigi.h.

bool EcalRawToDigi::srpUnpacking_
private

Definition at line 78 of file EcalRawToDigi.h.

Referenced by EcalRawToDigi(), and produce().

bool EcalRawToDigi::syncCheck_
private

Definition at line 82 of file EcalRawToDigi.h.

Referenced by EcalRawToDigi().

bool EcalRawToDigi::tccUnpacking_
private

Definition at line 79 of file EcalRawToDigi.h.

Referenced by EcalRawToDigi(), and produce().

DCCDataUnpacker* EcalRawToDigi::theUnpacker_
private

Definition at line 100 of file EcalRawToDigi.h.

Referenced by beginRun(), EcalRawToDigi(), produce(), and ~EcalRawToDigi().

edm::ESWatcher<EcalMappingRcd> EcalRawToDigi::watcher_

Definition at line 63 of file EcalRawToDigi.h.

Referenced by produce().