26 : ebDigiCollection_(ps.getParameter<std::
string>(
"ebDigiCollection")),
27 eeDigiCollection_(ps.getParameter<std::
string>(
"eeDigiCollection")),
28 digiProducer_(ps.getParameter<std::
string>(
"digiProducer")),
47 std::vector<int> listDefaults;
48 listDefaults.push_back(-1);
50 bool fedIsGiven =
false;
52 std::vector<std::string> ebDefaults;
53 ebDefaults.push_back(
"none");
57 edm::LogInfo(
"EcalDigiDisplay") <<
"FED id is given! Goining to beginRun! ";
60 if (requestedEbs_[0] !=
"none") {
64 for (std::vector<std::string>::const_iterator ebItr = requestedEbs_.begin(); ebItr != requestedEbs_.end();
71 for (
int i = 601;
i < 655; ++
i) {
83 std::vector<int>::iterator fedIter;
84 std::vector<int>::iterator intIter;
89 if ((*fedIter) < 601 || (*fedIter) > 655) {
90 edm::LogError(
"EcalDigiDisplay") <<
" FED value: " << (*fedIter) <<
" found in requetsedFeds. "
91 <<
" Valid range is 601-654. Returning.";
97 bool barrelSM =
false;
100 if ((*fedIter) > 609 && (*fedIter) < 646 &&
inputIsOk)
107 for (intIter = listChannels.begin(); intIter != listChannels.end(); intIter++) {
108 if (((*intIter) < 1) || (1700 < (*intIter))) {
109 edm::LogError(
"EcalDigiDisplay") <<
" ic value: " << (*intIter) <<
" found in listChannels. "
110 <<
" Valid range is 1-1700. Returning.";
118 for (intIter = listTowers.begin(); intIter != listTowers.end(); intIter++) {
119 if (((*intIter) < 1) || (70 < (*intIter))) {
120 edm::LogError(
"EcalDigiDisplay") <<
" TT value: " << (*intIter) <<
" found in listTowers. "
121 <<
" Valid range for EB SM is 1-70. Returning.";
130 for (intIter = listTowers.begin(); intIter != listTowers.end(); intIter++) {
131 if ((*intIter) > 34) {
132 edm::LogError(
"EcalDigiDisplay") <<
" TT value: " << (*intIter) <<
" found in listTowers. "
133 <<
" Valid range for EE DCC is 1-34. Returning.";
152 for (intIter = listPns.begin(); intIter != listPns.end(); intIter++) {
153 if (((*intIter) < 1) || (10 < (*intIter))) {
154 edm::LogError(
"EcalDigiDisplay") <<
" Pn number : " << (*intIter) <<
" found in listPns. "
155 <<
" Valid range is 1-10. Returning.";
171 edm::LogInfo(
"EcalDigiDisplay") <<
"entering beginRun! ";
191 edm::LogError(
"EcalDigiUnpackerModule") <<
"Can't get DCC Headers!";
195 bool ebDigisFound =
false;
196 bool eeDigisFound =
false;
197 bool pnDigisFound =
false;
202 edm::LogError(
"EcalDigiUnpackerModule") <<
"EB Digis were not found!";
204 if (!eb_digis->empty())
211 edm::LogError(
"EcalDigiUnpackerModule") <<
"EE Digis were not found!";
213 if (!ee_digis->empty())
220 edm::LogError(
"EcalDigiUnpackerModule") <<
"PNs were not found!";
222 if (!pn_digis->empty())
233 if (!(ebDigisFound || eeDigisFound)) {
234 edm::LogWarning(
"EcalDigiUnpackerModule") <<
"No Digis were found! Returning..";
253 int FEDid = elecId.
dccId() + 600;
258 int ic =
EBDetId((*digiItr).id()).ic();
263 edm::LogInfo(
"EcalDigiDisplay") <<
"\n\n^^^^^^^^^^^^^^^^^^ [EcalDigiDisplay] digi cry collection size "
270 }
else if (Mode == 2) {
271 std::vector<int>::iterator icIterCh;
272 std::vector<int>::iterator icIterTt;
277 edm::LogInfo(
"EcalDigiDisplay") <<
"\n\n^^^^^^^^^^^^^^^^^^ [EcalDigiDisplay] digi cry collection size "
280 edm::LogInfo(
"EcalDigiDisplay") <<
"[EcalDigiDisplay] parameter mode set to: " << Mode
281 <<
". Only mode 1 and 2 are allowed. Returning...";
285 std::cout <<
"FEDID: " << FEDid << std::endl;
287 <<
" i-phi: " <<
EBDetId((*digiItr).id()).iphi() <<
" j-eta: " <<
EBDetId((*digiItr).id()).ieta()
290 for (
unsigned int i = 0;
i < (*digiItr).size(); ++
i) {
304 std::cout <<
"For Endcap mode needs to be set to 2" << std::endl;
313 int FEDid = elecId.
dccId() + 600;
318 edm::LogInfo(
"EcalDigiDisplay") <<
"\n\n^^^^^^^^^^^^^^^^^^ [EcalDigiDisplay] digi cry collection size "
321 int crystalId = 10000 * FEDid + 100 * elecId.towerId() + 5 * (elecId.stripId() - 1) + elecId.xtalId();
322 int chId = elecId.towerId();
324 std::vector<int>::iterator icIterCh;
325 std::vector<int>::iterator icIterTt;
331 std::cout <<
"FEDID: " << FEDid << std::endl;
332 std::cout <<
"Tower: " << elecId.towerId() <<
"crystalId: " << crystalId
333 <<
" i-x: " <<
EEDetId((*digiItr).id()).ix() <<
" j-y: " <<
EEDetId((*digiItr).id()).iy() << std::endl;
336 for (
unsigned int i = 0;
i < (*digiItr).size(); ++
i) {
347 int pnDigiCounter = 0;
353 int FEDid = pnDetId.
iDCCId() + 600;
357 int pnNum = (*pnItr).id().iPnId();
360 edm::LogInfo(
"EcalDigiDisplay") <<
"\n\n^^^^^^^^^^^^^^^^^^ EcalDigiDisplay digi PN collection. Size: "
365 if ((pnDigiCounter++) >=
listPns[0])
367 }
else if (Mode == 2) {
368 edm::LogInfo(
"EcalDigiDisplay") <<
"\n\n^^^^^^^^^^^^^^^^^^ EcalDigiDisplay digi PN collection. Size: "
372 std::vector<int>::iterator pnIter;
377 edm::LogError(
"EcalDigiDisplay") <<
"[EcalDigiDisplay] parameter mode set to: " << Mode
378 <<
". Only mode 1 and 2 are allowed. Returning...";
384 std::cout <<
"\nPN num: " << (*pnItr).id().iPnId();
385 for (
int samId = 0; samId < (*pnItr).size(); samId++) {
388 std::cout <<
"sId: " << (samId + 1) <<
" " << (*pnItr).sample(samId) <<
"\t";
T getUntrackedParameter(std::string const &, T const &) const
const edm::EDGetTokenT< EcalRawDataCollection > rawDataToken_
const edm::EventSetup & c
const edm::EDGetTokenT< EEDigiCollection > eeDigiToken_
std::vector< int > requestedFeds_
bool getByToken(EDGetToken token, Handle< PROD > &result) const
Ecal readout channel identification [32:20] Unused (so far) [19:13] DCC id [12:6] tower [5:3] strip [...
void endRun(edm::Run const &, edm::EventSetup const &c) override
int getFedFromSlice(std::string)
std::vector< T >::const_iterator const_iterator
const edm::ESGetToken< EcalElectronicsMapping, EcalMappingRcd > ecalMappingToken_
EcalMGPASample sample(int i) const
const edm::EDGetTokenT< EcalPnDiodeDigiCollection > pnDiodeDigiToken_
void analyze(edm::Event const &e, edm::EventSetup const &c) override
std::vector< int > listPns
void readEBDigis(edm::Handle< EBDigiCollection > digis, int Mode)
Log< level::Error, false > LogError
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)
bool getData(T &iHolder) const
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
std::vector< int > listTowers
const EcalElectronicsMapping * ecalElectronicsMap_
Log< level::Info, false > LogInfo
~EcalDigiDisplay() override
std::vector< int > listChannels
boost::transform_iterator< IterHelp, boost::counting_iterator< int > > const_iterator
EcalDigiDisplay(const edm::ParameterSet &ps)
Log< level::Warning, false > LogWarning
std::vector< std::string > requestedEbs_
const edm::EDGetTokenT< EBDigiCollection > ebDigiToken_