52 std::vector<int> listDefaults;
53 listDefaults.push_back(-1);
55 bool fedIsGiven =
false;
57 std::vector<std::string> ebDefaults;
58 ebDefaults.push_back(
"none");
61 if ( requestedFeds_[0] != -1 ) {
62 edm::LogInfo(
"EcalDigiDisplay") <<
"FED id is given! Goining to beginRun! ";
65 if ( requestedEbs_[0] !=
"none" ) {
67 requestedFeds_.clear();
69 for (std::vector<std::string>::const_iterator ebItr = requestedEbs_.begin();
70 ebItr!= requestedEbs_.end(); ++ebItr) {
76 for (
int i=601;
i<655; ++
i){
77 requestedFeds_.push_back(
i);
88 std::vector<int>::iterator fedIter;
89 std::vector<int>::iterator intIter;
93 for ( fedIter = requestedFeds_.begin(); fedIter!=requestedFeds_.end(); ++fedIter) {
94 if ( (*fedIter) < 601 || (*fedIter) > 655 ) {
95 edm::LogError(
"EcalDigiDisplay") <<
" FED value: " << (*fedIter) <<
" found in requetsedFeds. " 96 <<
" Valid range is 601-654. Returning.";
102 bool barrelSM =
false;
104 for (fedIter = requestedFeds_.begin(); fedIter!=requestedFeds_.end(); ++fedIter) {
105 if ( (*fedIter) > 609 && (*fedIter) < 646 &&
inputIsOk )
112 for (intIter = listChannels.begin(); intIter != listChannels.end(); intIter++) {
113 if ( ((*intIter) < 1) || (1700 < (*intIter)) ) {
114 edm::LogError(
"EcalDigiDisplay") <<
" ic value: " << (*intIter) <<
" found in listChannels. " 115 <<
" Valid range is 1-1700. Returning.";
123 for (intIter = listTowers.begin(); intIter != listTowers.end(); intIter++) {
125 if ( ((*intIter) < 1) || (70 < (*intIter)) ) {
126 edm::LogError(
"EcalDigiDisplay") <<
" TT value: " << (*intIter) <<
" found in listTowers. " 127 <<
" Valid range for EB SM is 1-70. Returning.";
136 for (intIter = listTowers.begin(); intIter != listTowers.end(); intIter++) {
137 if ( (*intIter) > 34 ) {
138 edm::LogError(
"EcalDigiDisplay") <<
" TT value: " << (*intIter) <<
" found in listTowers. " 139 <<
" Valid range for EE DCC is 1-34. Returning.";
158 for (intIter = listPns.begin(); intIter != listPns.end(); intIter++) {
159 if ( ((*intIter) < 1) || (10 < (*intIter)) ) {
160 edm::LogError(
"EcalDigiDisplay") <<
" Pn number : " << (*intIter) <<
" found in listPns. " 161 <<
" Valid range is 1-10. Returning.";
177 edm::LogInfo(
"EcalDigiDisplay") <<
"entering beginRun! ";
195 edm::LogError(
"EcalDigiUnpackerModule") <<
"Can't get DCC Headers!";
199 bool ebDigisFound =
false;
200 bool eeDigisFound =
false;
201 bool pnDigisFound =
false;
206 if ( eb_digis->
size() != 0 )
209 edm::LogError(
"EcalDigiUnpackerModule") <<
"EB Digis were not found!";
216 if ( ee_digis->
size() != 0 )
219 edm::LogError(
"EcalDigiUnpackerModule") <<
"EE Digis were not found!";
226 if ( pn_digis->
size() != 0)
229 edm::LogError(
"EcalDigiUnpackerModule") <<
"PNs were not found!";
240 if ( !(ebDigisFound || eeDigisFound) ) {
241 edm::LogWarning(
"EcalDigiUnpackerModule") <<
"No Digis were found! Returning..";
263 int FEDid = elecId.
dccId() + 600;
267 int ic =
EBDetId((*digiItr).id()).ic();
268 int tt =
EBDetId((*digiItr).id()).tower().iTT();
272 edm::LogInfo(
"EcalDigiDisplay") <<
"\n\n^^^^^^^^^^^^^^^^^^ [EcalDigiDisplay] digi cry collection size " << digis->
size();
276 }
else if ( Mode==2 ) {
278 std::vector<int>::iterator icIterCh;
279 std::vector<int>::iterator icIterTt;
283 edm::LogInfo(
"EcalDigiDisplay") <<
"\n\n^^^^^^^^^^^^^^^^^^ [EcalDigiDisplay] digi cry collection size " << digis->
size();
285 edm::LogInfo(
"EcalDigiDisplay") <<
"[EcalDigiDisplay] parameter mode set to: " << Mode
286 <<
". Only mode 1 and 2 are allowed. Returning...";
290 std::cout <<
"FEDID: " << FEDid << std::endl;
293 <<
EBDetId((*digiItr).id()).ic() <<
" i-phi: " 294 <<
EBDetId((*digiItr).id()).iphi() <<
" j-eta: " 295 <<
EBDetId((*digiItr).id()).ieta() << std::endl;
297 for (
unsigned int i=0;
i< (*digiItr).size() ; ++
i ) {
311 std::cout <<
"For Endcap mode needs to be set to 2" << std::endl;
322 int FEDid = elecId.
dccId() + 600;
326 edm::LogInfo(
"EcalDigiDisplay") <<
"\n\n^^^^^^^^^^^^^^^^^^ [EcalDigiDisplay] digi cry collection size " << digis->
size();
328 int crystalId = 10000 * FEDid + 100 * elecId.towerId() + 5 * (elecId.stripId()-1)+elecId.xtalId();
329 int chId = elecId.towerId();
331 std::vector<int>::iterator icIterCh;
332 std::vector<int>::iterator icIterTt;
337 std::cout <<
"FEDID: " << FEDid << std::endl;
338 std::cout <<
"Tower: " << elecId.towerId()
340 << crystalId <<
" i-x: " 341 <<
EEDetId((*digiItr).id()).ix() <<
" j-y: " 342 <<
EEDetId((*digiItr).id()).iy() << std::endl;
345 for (
unsigned int i=0;
i< (*digiItr).size() ; ++
i ) {
356 int pnDigiCounter = 0;
362 int FEDid = pnDetId.
iDCCId() + 600;
365 int pnNum = (*pnItr).id().iPnId();
368 edm::LogInfo(
"EcalDigiDisplay") <<
"\n\n^^^^^^^^^^^^^^^^^^ EcalDigiDisplay digi PN collection. Size: " << PNs->
size();
369 edm::LogInfo(
"EcalDigiDisplay") <<
" [EcalDigiDisplay] dumping first " <<
listPns[0] <<
" PNs ";
371 if ( (pnDigiCounter++) >=
listPns[0] )
break;
372 }
else if ( Mode == 2) {
373 edm::LogInfo(
"EcalDigiDisplay") <<
"\n\n^^^^^^^^^^^^^^^^^^ EcalDigiDisplay digi PN collection. Size: " << PNs->
size();
376 std::vector<int>::iterator pnIter;
378 if (pnIter ==
listPns.end())
continue;
380 edm::LogError(
"EcalDigiDisplay")<<
"[EcalDigiDisplay] parameter mode set to: " << Mode
381 <<
". Only mode 1 and 2 are allowed. Returning...";
387 std::cout <<
"\nPN num: " << (*pnItr).id().iPnId();
388 for (
int samId=0; samId < (*pnItr).size() ; samId++ ) {
391 << (*pnItr).sample(samId)
T getParameter(std::string const &) const
T getUntrackedParameter(std::string const &, T const &) const
boost::transform_iterator< IterHelp, boost::counting_iterator< int > > const_iterator
std::vector< int > requestedFeds_
Ecal readout channel identification [32:20] Unused (so far) [19:13] DCC id [12:6] tower [5:3] strip [...
int getFedFromSlice(std::string)
std::vector< EcalPnDiodeDigi >::const_iterator const_iterator
EcalMGPASample sample(int i) const
std::vector< int > listPns
virtual void analyze(edm::Event const &e, edm::EventSetup const &c)
const_iterator begin() const
void readEBDigis(edm::Handle< EBDigiCollection > digis, int Mode)
void find(edm::Handle< EcalRecHitCollection > &hits, DetId thisDet, std::vector< EcalRecHitCollection::const_iterator > &hit, bool debug=false)
void readEEDigis(edm::Handle< EEDigiCollection > digis, int Mode)
std::string ebDigiCollection_
EcalElectronicsId getElectronicsId(const DetId &id) const
Get the electronics id for this det id.
void readPNDigis(edm::Handle< EcalPnDiodeDigiCollection > PNs, int Mode)
int iDCCId() const
get the DCCId
int dccId() const
get the DCC (Ecal Local DCC value not global one) id
bool getByLabel(InputTag const &tag, Handle< PROD > &result) const
const_iterator end() const
std::vector< int > listTowers
const EcalElectronicsMapping * ecalElectronicsMap_
std::vector< int > listChannels
EcalDigiDisplay(const edm::ParameterSet &ps)
const_iterator end() const
std::string eeDigiCollection_
virtual void beginRun(edm::Run const &, edm::EventSetup const &c)
T const * product() const
std::vector< std::string > requestedEbs_
const_iterator begin() const
std::string digiProducer_