54 std::vector<int> listDefaults;
55 listDefaults.push_back(-1);
57 bool fedIsGiven =
false;
59 std::vector<std::string> ebDefaults;
60 ebDefaults.push_back(
"none");
63 if ( requestedFeds_[0] != -1 ) {
64 edm::LogInfo(
"EcalDigiDisplay") <<
"FED id is given! Goining to beginRun! ";
67 if ( requestedEbs_[0] !=
"none" ) {
69 requestedFeds_.clear();
71 for (std::vector<std::string>::const_iterator ebItr = requestedEbs_.begin();
72 ebItr!= requestedEbs_.end(); ++ebItr) {
78 for (
int i=601;
i<655; ++
i){
79 requestedFeds_.push_back(
i);
90 std::vector<int>::iterator fedIter;
91 std::vector<int>::iterator intIter;
95 for ( fedIter = requestedFeds_.begin(); fedIter!=requestedFeds_.end(); ++fedIter) {
96 if ( (*fedIter) < 601 || (*fedIter) > 655 ) {
97 edm::LogError(
"EcalDigiDisplay") <<
" FED value: " << (*fedIter) <<
" found in requetsedFeds. "
98 <<
" Valid range is 601-654. Returning.";
104 bool barrelSM =
false;
106 for (fedIter = requestedFeds_.begin(); fedIter!=requestedFeds_.end(); ++fedIter) {
107 if ( (*fedIter) > 609 && (*fedIter) < 646 &&
inputIsOk )
114 for (intIter = listChannels.begin(); intIter != listChannels.end(); intIter++) {
115 if ( ((*intIter) < 1) || (1700 < (*intIter)) ) {
116 edm::LogError(
"EcalDigiDisplay") <<
" ic value: " << (*intIter) <<
" found in listChannels. "
117 <<
" Valid range is 1-1700. Returning.";
125 for (intIter = listTowers.begin(); intIter != listTowers.end(); intIter++) {
127 if ( ((*intIter) < 1) || (70 < (*intIter)) ) {
128 edm::LogError(
"EcalDigiDisplay") <<
" TT value: " << (*intIter) <<
" found in listTowers. "
129 <<
" Valid range for EB SM is 1-70. Returning.";
138 for (intIter = listTowers.begin(); intIter != listTowers.end(); intIter++) {
139 if ( (*intIter) > 34 ) {
140 edm::LogError(
"EcalDigiDisplay") <<
" TT value: " << (*intIter) <<
" found in listTowers. "
141 <<
" Valid range for EE DCC is 1-34. Returning.";
160 for (intIter = listPns.begin(); intIter != listPns.end(); intIter++) {
161 if ( ((*intIter) < 1) || (10 < (*intIter)) ) {
162 edm::LogError(
"EcalDigiDisplay") <<
" Pn number : " << (*intIter) <<
" found in listPns. "
163 <<
" Valid range is 1-10. Returning.";
179 edm::LogInfo(
"EcalDigiDisplay") <<
"entering beginRun! ";
197 edm::LogError(
"EcalDigiUnpackerModule") <<
"Can't get DCC Headers!";
201 bool ebDigisFound =
false;
202 bool eeDigisFound =
false;
203 bool pnDigisFound =
false;
208 if ( eb_digis->size() != 0 )
211 edm::LogError(
"EcalDigiUnpackerModule") <<
"EB Digis were not found!";
218 if ( ee_digis->size() != 0 )
221 edm::LogError(
"EcalDigiUnpackerModule") <<
"EE Digis were not found!";
228 if ( pn_digis->size() != 0)
231 edm::LogError(
"EcalDigiUnpackerModule") <<
"PNs were not found!";
242 if ( !(ebDigisFound || eeDigisFound) ) {
243 edm::LogWarning(
"EcalDigiUnpackerModule") <<
"No Digis were found! Returning..";
265 int FEDid = elecId.dccId() + 600;
269 int ic =
EBDetId((*digiItr).id()).ic();
270 int tt =
EBDetId((*digiItr).id()).tower().iTT();
274 edm::LogInfo(
"EcalDigiDisplay") <<
"\n\n^^^^^^^^^^^^^^^^^^ [EcalDigiDisplay] digi cry collection size " << digis->size();
278 }
else if ( Mode==2 ) {
280 std::vector<int>::iterator icIterCh;
281 std::vector<int>::iterator icIterTt;
285 edm::LogInfo(
"EcalDigiDisplay") <<
"\n\n^^^^^^^^^^^^^^^^^^ [EcalDigiDisplay] digi cry collection size " << digis->size();
287 edm::LogInfo(
"EcalDigiDisplay") <<
"[EcalDigiDisplay] parameter mode set to: " << Mode
288 <<
". Only mode 1 and 2 are allowed. Returning...";
292 std::cout <<
"FEDID: " << FEDid << std::endl;
295 <<
EBDetId((*digiItr).id()).ic() <<
" i-phi: "
296 <<
EBDetId((*digiItr).id()).iphi() <<
" j-eta: "
297 <<
EBDetId((*digiItr).id()).ieta() << std::endl;
299 for (
unsigned int i=0;
i< (*digiItr).size() ; ++
i ) {
313 std::cout <<
"For Endcap mode needs to be set to 2" << std::endl;
324 int FEDid = elecId.dccId() + 600;
328 edm::LogInfo(
"EcalDigiDisplay") <<
"\n\n^^^^^^^^^^^^^^^^^^ [EcalDigiDisplay] digi cry collection size " << digis->size();
330 int crystalId = 10000 * FEDid + 100 * elecId.towerId() + 5 * (elecId.stripId()-1)+elecId.xtalId();
331 int chId = elecId.towerId();
333 std::vector<int>::iterator icIterCh;
334 std::vector<int>::iterator icIterTt;
339 std::cout <<
"FEDID: " << FEDid << std::endl;
340 std::cout <<
"Tower: " << elecId.towerId()
342 << crystalId <<
" i-x: "
343 <<
EEDetId((*digiItr).id()).ix() <<
" j-y: "
344 <<
EEDetId((*digiItr).id()).iy() << std::endl;
347 for (
unsigned int i=0;
i< (*digiItr).size() ; ++
i ) {
358 int pnDigiCounter = 0;
367 int pnNum = (*pnItr).id().iPnId();
370 edm::LogInfo(
"EcalDigiDisplay") <<
"\n\n^^^^^^^^^^^^^^^^^^ EcalDigiDisplay digi PN collection. Size: " << PNs->size();
371 edm::LogInfo(
"EcalDigiDisplay") <<
" [EcalDigiDisplay] dumping first " <<
listPns[0] <<
" PNs ";
373 if ( (pnDigiCounter++) >=
listPns[0] )
break;
374 }
else if ( Mode == 2) {
375 edm::LogInfo(
"EcalDigiDisplay") <<
"\n\n^^^^^^^^^^^^^^^^^^ EcalDigiDisplay digi PN collection. Size: " << PNs->size();
378 std::vector<int>::iterator pnIter;
380 if (pnIter ==
listPns.end())
continue;
382 edm::LogError(
"EcalDigiDisplay")<<
"[EcalDigiDisplay] parameter mode set to: " << Mode
383 <<
". Only mode 1 and 2 are allowed. Returning...";
389 std::cout <<
"\nPN num: " << (*pnItr).id().iPnId();
390 for (
int samId=0; samId < (*pnItr).size() ; samId++ ) {
393 << (*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< T >::const_iterator const_iterator
EcalMGPASample sample(int i) const
std::vector< int > listPns
virtual void analyze(edm::Event const &e, edm::EventSetup const &c)
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
bool getByLabel(InputTag const &tag, Handle< PROD > &result) const
std::vector< int > listTowers
const EcalElectronicsMapping * ecalElectronicsMap_
std::vector< int > listChannels
T const * product() const
EcalDigiDisplay(const edm::ParameterSet &ps)
std::string eeDigiCollection_
virtual void beginRun(edm::Run const &, edm::EventSetup const &c)
std::vector< std::string > requestedEbs_
std::string digiProducer_