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(); ebItr != requestedEbs_.end();
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++) {
124 if (((*intIter) < 1) || (70 < (*intIter))) {
125 edm::LogError(
"EcalDigiDisplay") <<
" TT value: " << (*intIter) <<
" found in listTowers. " 126 <<
" Valid range for EB SM is 1-70. Returning.";
135 for (intIter = listTowers.begin(); intIter != listTowers.end(); intIter++) {
136 if ((*intIter) > 34) {
137 edm::LogError(
"EcalDigiDisplay") <<
" TT value: " << (*intIter) <<
" found in listTowers. " 138 <<
" Valid range for EE DCC is 1-34. Returning.";
157 for (intIter = listPns.begin(); intIter != listPns.end(); intIter++) {
158 if (((*intIter) < 1) || (10 < (*intIter))) {
159 edm::LogError(
"EcalDigiDisplay") <<
" Pn number : " << (*intIter) <<
" found in listPns. " 160 <<
" Valid range is 1-10. Returning.";
176 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->
empty())
209 edm::LogError(
"EcalDigiUnpackerModule") <<
"EB Digis were not found!";
216 if (!ee_digis->
empty())
219 edm::LogError(
"EcalDigiUnpackerModule") <<
"EE Digis were not found!";
226 if (!pn_digis->
empty())
229 edm::LogError(
"EcalDigiUnpackerModule") <<
"PNs were not found!";
240 if (!(ebDigisFound || eeDigisFound)) {
241 edm::LogWarning(
"EcalDigiUnpackerModule") <<
"No Digis were found! Returning..";
260 int FEDid = elecId.
dccId() + 600;
265 int ic =
EBDetId((*digiItr).id()).ic();
266 int tt =
EBDetId((*digiItr).id()).tower().iTT();
270 edm::LogInfo(
"EcalDigiDisplay") <<
"\n\n^^^^^^^^^^^^^^^^^^ [EcalDigiDisplay] digi cry collection size " 277 }
else if (Mode == 2) {
278 std::vector<int>::iterator icIterCh;
279 std::vector<int>::iterator icIterTt;
284 edm::LogInfo(
"EcalDigiDisplay") <<
"\n\n^^^^^^^^^^^^^^^^^^ [EcalDigiDisplay] digi cry collection 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;
293 std::cout <<
"Tower: " <<
EBDetId((*digiItr).id()).tower().iTT() <<
" ic-cry: " <<
EBDetId((*digiItr).id()).ic()
294 <<
" i-phi: " <<
EBDetId((*digiItr).id()).iphi() <<
" j-eta: " <<
EBDetId((*digiItr).id()).ieta()
297 for (
unsigned int i = 0;
i < (*digiItr).size(); ++
i) {
311 std::cout <<
"For Endcap mode needs to be set to 2" << std::endl;
320 int FEDid = elecId.
dccId() + 600;
325 edm::LogInfo(
"EcalDigiDisplay") <<
"\n\n^^^^^^^^^^^^^^^^^^ [EcalDigiDisplay] digi cry collection 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;
338 std::cout <<
"FEDID: " << FEDid << std::endl;
339 std::cout <<
"Tower: " << elecId.towerId() <<
"crystalId: " << crystalId
340 <<
" i-x: " <<
EEDetId((*digiItr).id()).ix() <<
" j-y: " <<
EEDetId((*digiItr).id()).iy() << std::endl;
343 for (
unsigned int i = 0;
i < (*digiItr).size(); ++
i) {
354 int pnDigiCounter = 0;
360 int FEDid = pnDetId.
iDCCId() + 600;
364 int pnNum = (*pnItr).id().iPnId();
367 edm::LogInfo(
"EcalDigiDisplay") <<
"\n\n^^^^^^^^^^^^^^^^^^ EcalDigiDisplay digi PN collection. Size: " 372 if ((pnDigiCounter++) >=
listPns[0])
374 }
else if (Mode == 2) {
375 edm::LogInfo(
"EcalDigiDisplay") <<
"\n\n^^^^^^^^^^^^^^^^^^ EcalDigiDisplay digi PN collection. Size: " 379 std::vector<int>::iterator pnIter;
384 edm::LogError(
"EcalDigiDisplay") <<
"[EcalDigiDisplay] parameter mode set to: " << Mode
385 <<
". Only mode 1 and 2 are allowed. Returning...";
391 std::cout <<
"\nPN num: " << (*pnItr).id().iPnId();
392 for (
int samId = 0; samId < (*pnItr).size(); samId++) {
395 std::cout <<
"sId: " << (samId + 1) <<
" " << (*pnItr).sample(samId) <<
"\t";
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
void analyze(edm::Event const &e, edm::EventSetup const &c) override
std::vector< int > listPns
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 beginRun(edm::Run const &, edm::EventSetup const &c) override
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_
~EcalDigiDisplay() override
std::vector< int > listChannels
EcalDigiDisplay(const edm::ParameterSet &ps)
const_iterator end() const
std::string eeDigiCollection_
T const * product() const
std::vector< std::string > requestedEbs_
const_iterator begin() const
std::string digiProducer_