#include <EventFilter/EcalDigiToRaw/src/EcalDigiToRaw.cc>
Description: <one line="" class="" summary>="">
Implementation: <Notes on="" implementation>="">
Definition at line 49 of file EcalDigiToRaw.h.
typedef unsigned int EcalDigiToRaw::Word32 |
Definition at line 59 of file EcalDigiToRaw.h.
typedef long long EcalDigiToRaw::Word64 |
Definition at line 58 of file EcalDigiToRaw.h.
EcalDigiToRaw::EcalDigiToRaw | ( | const edm::ParameterSet & | pset | ) |
Definition at line 50 of file EcalDigiToRaw.cc.
References edm::ParameterSet::getParameter(), and edm::ParameterSet::getUntrackedParameter().
{ doTCC_ = iConfig.getUntrackedParameter<bool>("WriteTCCBlock"); doSR_ = iConfig.getUntrackedParameter<bool>("WriteSRFlags"); doTower_ = iConfig.getUntrackedParameter<bool>("WriteTowerBlock"); doBarrel_ = iConfig.getUntrackedParameter<bool>("DoBarrel"); doEndCap_ = iConfig.getUntrackedParameter<bool>("DoEndCap"); listDCCId_ = iConfig.getUntrackedParameter< std::vector<int32_t> >("listDCCId"); label_= iConfig.getParameter<string>("Label"); instanceNameEB_ = iConfig.getParameter<string>("InstanceEB"); instanceNameEE_ = iConfig.getParameter<string>("InstanceEE"); labelTT_ = iConfig.getParameter<edm::InputTag>("labelTT"); labelEBSR_ = iConfig.getParameter<edm::InputTag>("labelEBSRFlags"); labelEESR_ = iConfig.getParameter<edm::InputTag>("labelEESRFlags"); counter_ = 0; debug_ = iConfig.getUntrackedParameter<bool>("debug"); Towerblockformatter_ = new TowerBlockFormatter; TCCblockformatter_ = new TCCBlockFormatter(); SRblockformatter_ = new SRBlockFormatter(); Headerblockformatter_= new BlockFormatter; produces<FEDRawDataCollection>(); }
EcalDigiToRaw::~EcalDigiToRaw | ( | ) | [virtual] |
Definition at line 85 of file EcalDigiToRaw.cc.
{ // do anything here that needs to be done at desctruction time // (e.g. close files, deallocate resources etc.) delete Towerblockformatter_; delete TCCblockformatter_; delete SRblockformatter_; delete Headerblockformatter_; }
void EcalDigiToRaw::beginJob | ( | void | ) | [virtual] |
Reimplemented from edm::EDProducer.
Definition at line 291 of file EcalDigiToRaw.cc.
{ Headerblockformatter_ -> SetParam(this); Towerblockformatter_ -> SetParam(this); TCCblockformatter_ -> SetParam(this); SRblockformatter_ -> SetParam(this); }
void EcalDigiToRaw::endJob | ( | void | ) | [virtual] |
int* EcalDigiToRaw::GetBX | ( | ) | [inline] |
int* EcalDigiToRaw::GetCounter | ( | ) | [inline] |
bool EcalDigiToRaw::GetDebug | ( | ) | [inline] |
bool EcalDigiToRaw::GetDoBarrel | ( | ) | [inline] |
bool EcalDigiToRaw::GetDoEndCap | ( | ) | [inline] |
bool EcalDigiToRaw::GetDoSR | ( | ) | [inline] |
bool EcalDigiToRaw::GetDoTCC | ( | ) | [inline] |
bool EcalDigiToRaw::GetDoTower | ( | ) | [inline] |
std::vector<int32_t>* EcalDigiToRaw::GetListDCCId | ( | ) | [inline] |
int* EcalDigiToRaw::GetLV1 | ( | ) | [inline] |
int* EcalDigiToRaw::GetOrbit | ( | ) | [inline] |
int* EcalDigiToRaw::GetRunNumber | ( | ) | [inline] |
void EcalDigiToRaw::produce | ( | edm::Event & | e, |
const edm::EventSetup & | c | ||
) | [virtual] |
Implements edm::EDProducer.
Definition at line 105 of file EcalDigiToRaw.cc.
References begin, edm::EventBase::bunchCrossing(), gather_cfg::cout, EcalElectronicsId::dccId(), cond::rpcobgas::detid, DigiToRaw_cff::DigiToRaw, EcalBarrel, EcalEndcap, end, edm::EventID::event(), L1Comparator_cfi::FEDid, edm::EventSetup::get(), edm::Event::getByLabel(), EcalSrFlag::id(), edm::EventBase::id(), FEDNumbering::MINECALFEDID, edm::EventBase::orbitNumber(), edm::print(), edm::ESHandle< T >::product(), edm::Event::put(), lumiPlot::rawdata, edm::EventID::run(), EcalTrigTowerDetId::subDet(), and EcalSrFlag::value().
{ if (debug_) cout << "Enter in EcalDigiToRaw::produce ... " << endl; ESHandle< EcalElectronicsMapping > ecalmapping; iSetup.get< EcalMappingRcd >().get(ecalmapping); const EcalElectronicsMapping* TheMapping = ecalmapping.product(); Towerblockformatter_ -> StartEvent(); SRblockformatter_ -> StartEvent(); runnumber_ = iEvent.id().run(); // bx_ = (counter_ % BXMAX); // orbit_number_ = counter_ / BXMAX; // counter_ ++; counter_ = iEvent.id().event(); bx_ = iEvent.bunchCrossing(); orbit_number_ = iEvent.orbitNumber(); lv1_ = counter_ % (0x1<<24); auto_ptr<FEDRawDataCollection> productRawData(new FEDRawDataCollection); Headerblockformatter_ -> DigiToRaw(productRawData.get()); // --------- Now the Trigger Block part Handle<EcalTrigPrimDigiCollection> ecalTrigPrim; Handle<EBSrFlagCollection> ebSrFlags; Handle<EESrFlagCollection> eeSrFlags; if (doTCC_) { if (debug_) cout << "Creation of the TCC block " << endl; // iEvent.getByType(ecalTrigPrim); iEvent.getByLabel(labelTT_, ecalTrigPrim); // loop on TP's and add one by one to the block for (EcalTrigPrimDigiCollection::const_iterator it = ecalTrigPrim -> begin(); it != ecalTrigPrim -> end(); it++) { const EcalTriggerPrimitiveDigi& trigprim = *it; const EcalTrigTowerDetId& detid = it -> id(); if ( (detid.subDet() == EcalBarrel) && (! doBarrel_) ) continue; if ( (detid.subDet() == EcalEndcap) && (! doEndCap_) ) continue; int iDCC = TheMapping -> DCCid(detid); int FEDid = FEDNumbering::MINECALFEDID + iDCC; FEDRawData& rawdata = productRawData.get() -> FEDData(FEDid); // adding the primitive to the block TCCblockformatter_ -> DigiToRaw(trigprim, rawdata, TheMapping); } // end loop on ecalTrigPrim } // endif doTCC if (doSR_) { if (debug_) cout << " Process the SR flags " << endl; if (doBarrel_) { // iEvent.getByType(ebSrFlags); iEvent.getByLabel(labelEBSR_, ebSrFlags); for (EBSrFlagCollection::const_iterator it = ebSrFlags -> begin(); it != ebSrFlags -> end(); it++) { const EcalSrFlag& srflag = *it; int flag = srflag.value(); EcalTrigTowerDetId id = srflag.id(); int Dccid = TheMapping -> DCCid(id); int DCC_Channel = TheMapping -> iTT(id); int FEDid = FEDNumbering::MINECALFEDID + Dccid; // if (Dccid == 10) cout << "Dcc " << Dccid << " DCC_Channel " << DCC_Channel << " flag " << flag << endl; if (debug_) cout << "will process SRblockformatter_ for FEDid " << dec << FEDid << endl; FEDRawData& rawdata = productRawData.get() -> FEDData(FEDid); if (debug_) Headerblockformatter_ -> print(rawdata); SRblockformatter_ -> DigiToRaw(Dccid,DCC_Channel,flag, rawdata); } } // end DoBarrel if (doEndCap_) { // iEvent.getByType(eeSrFlags); iEvent.getByLabel(labelEESR_, eeSrFlags); for (EESrFlagCollection::const_iterator it = eeSrFlags -> begin(); it != eeSrFlags -> end(); it++) { const EcalSrFlag& srflag = *it; int flag = srflag.value(); EcalScDetId id = srflag.id(); pair<int, int> ind = TheMapping -> getDCCandSC(id); int Dccid = ind.first; int DCC_Channel = ind.second; int FEDid = FEDNumbering::MINECALFEDID + Dccid; FEDRawData& rawdata = productRawData.get() -> FEDData(FEDid); SRblockformatter_ -> DigiToRaw(Dccid,DCC_Channel,flag, rawdata); } } // end doEndCap } // endif doSR // --------- Now the Tower Block part Handle<EBDigiCollection> ebDigis; Handle<EEDigiCollection> eeDigis; if (doTower_) { if (doBarrel_) { if (debug_) cout << "Creation of the TowerBlock ... Barrel case " << endl; iEvent.getByLabel(label_,instanceNameEB_,ebDigis); for (EBDigiCollection::const_iterator it=ebDigis -> begin(); it != ebDigis->end(); it++) { const EBDataFrame& dataframe = *it; const EBDetId& ebdetid = it -> id(); int DCCid = TheMapping -> DCCid(ebdetid); int FEDid = FEDNumbering::MINECALFEDID + DCCid ; FEDRawData& rawdata = productRawData.get() -> FEDData(FEDid); Towerblockformatter_ -> DigiToRaw(dataframe, rawdata, TheMapping); } } if (doEndCap_) { if (debug_) cout << "Creation of the TowerBlock ... EndCap case " << endl; iEvent.getByLabel(label_,instanceNameEE_,eeDigis); for (EEDigiCollection::const_iterator it=eeDigis -> begin(); it != eeDigis->end(); it++) { const EEDataFrame& dataframe = *it; const EEDetId& eedetid = it -> id(); EcalElectronicsId elid = TheMapping -> getElectronicsId(eedetid); int DCCid = elid.dccId() ; int FEDid = FEDNumbering::MINECALFEDID + DCCid; FEDRawData& rawdata = productRawData.get() -> FEDData(FEDid); Towerblockformatter_ -> DigiToRaw(dataframe, rawdata, TheMapping); } } } // endif doTower_ // -------- Clean up things ... map<int, map<int,int> >* FEDorder = Towerblockformatter_ -> GetFEDorder(); Headerblockformatter_ -> CleanUp(productRawData.get(), FEDorder); /* cout << "For FED 633 " << endl; FEDRawData& rawdata = productRawData -> FEDData(633); Headerblockformatter_ -> print(rawdata); */ // Headerblockformatter_ -> PrintSizes(productRawData.get()); Towerblockformatter_ -> EndEvent(productRawData.get()); iEvent.put(productRawData); return; }
int EcalDigiToRaw::bx_ [private] |
Definition at line 87 of file EcalDigiToRaw.h.
Referenced by GetBX().
const int EcalDigiToRaw::BXMAX = 2808 [static] |
Definition at line 75 of file EcalDigiToRaw.h.
int EcalDigiToRaw::counter_ [private] |
Definition at line 83 of file EcalDigiToRaw.h.
Referenced by GetCounter().
bool EcalDigiToRaw::debug_ [private] |
Definition at line 85 of file EcalDigiToRaw.h.
Referenced by GetDebug().
bool EcalDigiToRaw::doBarrel_ [private] |
Definition at line 98 of file EcalDigiToRaw.h.
Referenced by GetDoBarrel().
bool EcalDigiToRaw::doEndCap_ [private] |
Definition at line 99 of file EcalDigiToRaw.h.
Referenced by GetDoEndCap().
bool EcalDigiToRaw::doSR_ [private] |
Definition at line 91 of file EcalDigiToRaw.h.
Referenced by GetDoSR().
bool EcalDigiToRaw::doTCC_ [private] |
Definition at line 90 of file EcalDigiToRaw.h.
Referenced by GetDoTCC().
bool EcalDigiToRaw::doTower_ [private] |
Definition at line 92 of file EcalDigiToRaw.h.
Referenced by GetDoTower().
Definition at line 109 of file EcalDigiToRaw.h.
std::string EcalDigiToRaw::instanceNameEB_ [private] |
Definition at line 104 of file EcalDigiToRaw.h.
std::string EcalDigiToRaw::instanceNameEE_ [private] |
Definition at line 105 of file EcalDigiToRaw.h.
std::string EcalDigiToRaw::label_ [private] |
Definition at line 103 of file EcalDigiToRaw.h.
edm::InputTag EcalDigiToRaw::labelEBSR_ [private] |
Definition at line 95 of file EcalDigiToRaw.h.
edm::InputTag EcalDigiToRaw::labelEESR_ [private] |
Definition at line 96 of file EcalDigiToRaw.h.
edm::InputTag EcalDigiToRaw::labelTT_ [private] |
Definition at line 94 of file EcalDigiToRaw.h.
std::vector<int32_t> EcalDigiToRaw::listDCCId_ [private] |
Definition at line 101 of file EcalDigiToRaw.h.
Referenced by GetListDCCId().
int EcalDigiToRaw::lv1_ [private] |
Definition at line 88 of file EcalDigiToRaw.h.
Referenced by GetLV1().
int EcalDigiToRaw::orbit_number_ [private] |
Definition at line 84 of file EcalDigiToRaw.h.
Referenced by GetOrbit().
int EcalDigiToRaw::runnumber_ [private] |
Definition at line 86 of file EcalDigiToRaw.h.
Referenced by GetRunNumber().
SRBlockFormatter* EcalDigiToRaw::SRblockformatter_ [private] |
Definition at line 110 of file EcalDigiToRaw.h.
Definition at line 108 of file EcalDigiToRaw.h.
Definition at line 107 of file EcalDigiToRaw.h.