20 #include "TObjArray.h"
21 #include "TObjString.h"
25 using namespace ecaldqm;
29 cacheOtype_(nObjType),
30 cacheBtype_(nBinType),
34 verbosity_(_ps.getUntrackedParameter<int>(
"verbosity"))
65 std::vector<EcalDQMBinningService::AxisSpecs>
69 return std::vector<AxisSpecs>(0);
91 return std::vector<AxisSpecs>(0);
134 const std::vector<int>*
151 const std::vector<int>* binMap(0);
186 std::cout <<
"EcalDQMBinningService: Booked new binMap for " << int(_okey) <<
" " << int(_bkey);
189 for(
unsigned iO(0); iO <
nPlotType; iO++)
192 std::cout << bytes / 1024. <<
"kB)" << std::endl;
198 std::pair<unsigned, std::vector<int> >
205 pair<unsigned, std::vector<int> >
ret(-1, std::vector<int>(0));
210 if(ret.first ==
unsigned(-1))
return ret;
218 const std::vector<int>* binMap(
getBinMap(okey, bkey));
219 if(binMap == 0)
return ret;
248 for(vector<int>::iterator binItr(ret.second.begin()); binItr != ret.second.end(); ++binItr)
260 std::pair<unsigned, std::vector<int> >
266 std::pair<unsigned, std::vector<int> >
273 pair<unsigned, std::vector<int> >
ret(-1, std::vector<int>(0));
277 ret.first =
findOffset(_otype, _btype, _dcctccid);
279 if(ret.first ==
unsigned(-1))
return ret;
285 const std::vector<int>* binMap(
getBinMap(okey, bkey));
286 if(binMap == 0)
return ret;
288 unsigned index(_dcctccid - 1);
301 ret.second.push_back(binMap->at(index));
311 std::pair<unsigned, std::vector<int> >
321 throw cms::Exception(
"NotImplemented") <<
"1D bin finding only for SM - SC plots or Ecal2P - DCC plots" << std::endl;
324 return findBins(_otype, _btype, _id);
326 pair<unsigned, std::vector<int> >
ret(-1, std::vector<int>(0));
329 if(ret.first ==
unsigned(-1))
return ret;
332 ret.second.push_back(
towerId(_id));
334 unsigned tccid(
tccId(_id));
335 if(tccid >= 37 && tccid <= 72)
336 ret.second.push_back(
ttId(_id));
339 tccid = (tccid - 1) % 36;
340 bool outer(tccid >= 18);
341 tccid = (tccid + 1) % 18;
343 bin += (tccid % 2) * (outer ? 16 : 24);
344 ret.second.push_back(bin);
351 std::pair<unsigned, std::vector<int> >
362 unsigned iSM(
dccId(_id) - 1);
374 else if(_otype ==
kEcal)
394 unsigned iSM(_dcctccid - 1);
405 else if(_btype ==
kTCC &&
418 if(iSM <
nDCC)
return iSM;
424 if(_btype ==
kDCC && iSM <
nDCC)
return 0;
425 else if(_btype ==
kTCC && iSM <
nTCC)
return 0;
426 else if(_btype ==
kUser)
return 0;
436 else if(_btype ==
kTCC){
441 if(iSubdet ==
kEE || iSubdet ==
kEEm || iSubdet ==
kEEp)
return 0;
442 else if(iSubdet ==
kEB)
return 1;
453 else if(_btype ==
kTCC){
458 if(iSubdet ==
kEEm)
return 0;
459 else if(iSubdet ==
kEB)
return 1;
460 else if(iSubdet ==
kEEp)
return 2;
466 if(iSubdet ==
kEE || iSubdet ==
kEEm || iSubdet ==
kEEp)
return 0;
467 else if(iSubdet ==
kEB)
return 1;
507 if(!_offset)
return 0;
517 if(offset >
kEEp02) ext += 1;
518 if(offset >
kEEp08) ext += 1;
523 bins += offBins;
break;
525 bins += offBins / 25;
break;
535 bins += offBins;
break;
538 bins += offBins / 25;
break;
546 if(offset >
kEEm02) ext += 1;
547 if(offset >
kEEm08) ext += 1;
552 bins += offBins;
break;
554 bins += offBins / 25;
break;
576 std::stringstream ss;
588 ss <<
" (EB ieta " << std::showpos << ebid.
ieta() << std::noshowpos <<
" iphi " << ebid.
iphi() <<
")";
592 ss <<
" (EE ix " << eeid.
ix() <<
" iy " << eeid.
iy() <<
")";
613 ss <<
" (EBTT ieta " << std::showpos << ttid.
ieta() << std::noshowpos <<
" iphi " << ttid.
iphi() <<
")";
617 ss <<
" (EESC ix " << scid.
ix() <<
" iy " << scid.
iy() <<
")";
624 int tccid(_rawId -
nDCC);
626 ss <<
smName(dccid) <<
" TCC " << (_rawId -
nDCC);
643 TPRegexp re(
"(EB|EE)([+-][0-9][0-9])(?: TCC ([0-9]+)| DCC ([0-9]+) (CCU|TCC) ([0-9]+)(?: (?:TT|strip) ([0-9]+)(?: xtal ([0-9]+)|)|)|)");
647 TObjArray* matches(re.MatchS(name));
648 if(matches->GetEntries() == 0)
return 0;
649 else if(matches->GetEntries() == 3){
650 TString subdet(static_cast<TObjString*>(matches->At(1))->GetString());
652 int dccid(static_cast<TObjString*>(matches->At(2))->GetString().Atoi());
659 rawId = (dccid + 2) % 9 + 1 + offset;
662 int dccid(static_cast<TObjString*>(matches->At(2))->GetString().Atoi());
663 if(dccid < 0) dccid *= -1;
668 else if(matches->GetEntries() == 4)
669 rawId = static_cast<TObjString*>(matches->At(3))->GetString().Atoi() +
nDCC;
671 TString subtype(static_cast<TObjString*>(matches->At(5))->GetString());
672 if(subtype ==
"TCC"){
673 int tccid(static_cast<TObjString*>(matches->At(6))->GetString().Atoi());
674 int ttid(static_cast<TObjString*>(matches->At(7))->GetString().Atoi());
678 int dccid(static_cast<TObjString*>(matches->At(4))->GetString().Atoi());
679 int towerid(static_cast<TObjString*>(matches->At(6))->GetString().Atoi());
680 if(matches->GetEntries() == 7)
683 int stripid(static_cast<TObjString*>(matches->At(7))->GetString().Atoi());
684 int xtalid(static_cast<TObjString*>(matches->At(8))->GetString().Atoi());
void watchPostBeginRun(PostBeginRun::slot_type const &iSlot)
std::vector< AxisSpecs > getBinningEBMEM_(BinningType, bool) const
const std::vector< int > * getBinMapSMMEM_(BinningType) const
unsigned memDCCIndex(unsigned)
std::string channelName(uint32_t, BinningType _btype=kDCC) const
std::vector< AxisSpecs > getBinningEcal_(BinningType, bool) const
const EcalElectronicsMapping * getElectronicsMap()
void findBinsDCC_(const DetId &, ObjectType, const std::vector< int > &, std::vector< int > &) const
void setTrigTowerMap(const EcalTrigTowerConstituentsMap *)
int tccId() const
get the DCC (Ecal Local DCC value not global one) id
int xtalId() const
get the channel id
const std::vector< int > * getBinMapEcal_(BinningType) const
int stripId() const
get the tower id
Ecal readout channel identification [32:20] Unused (so far) [19:13] DCC id [12:6] tower [5:3] strip [...
const std::vector< int > * getBinMap(ObjectType &, BinningType &) const
std::string smName(unsigned _dccId)
std::vector< AxisSpecs > getBinning(ObjectType, BinningType, bool _isMap=true, unsigned _objOffset=0) const
int towerId() const
get the tower id
unsigned dccId(const DetId &)
std::vector< AxisSpecs > getBinningSMMEM_(BinningType, bool, unsigned) const
void findBinsTCC_(const DetId &, ObjectType, const std::vector< int > &, std::vector< int > &) const
const std::vector< int > * getBinMapEE_(BinningType, int) const
int channelId() const
get the channel id
int ieta() const
get the tower ieta
ObjectType objectFromOffset(ObjectType, unsigned) const
int iphi() const
get the crystal iphi
const std::vector< int > * getBinMapEEMEM_(BinningType) const
void findBinsProjPhi_(const DetId &, ObjectType, const std::vector< int > &, std::vector< int > &) const
void findBinsCrystal_(const DetId &, ObjectType, const std::vector< int > &, std::vector< int > &) const
void setElectronicsMap(const EcalElectronicsMapping *)
unsigned towerId(const DetId &)
void findBinsSuperCrystal_(const DetId &, ObjectType, const std::vector< int > &, std::vector< int > &) const
std::vector< AxisSpecs > getBinningEE_(BinningType, bool, int) const
void postBeginRun(const edm::Run &, const edm::EventSetup &)
int ttId() const
get the tower id
std::vector< int > binMaps_[nPlotType][nPresetBinnings]
const std::vector< int > * getBinMapSM_(BinningType) const
unsigned findOffset(ObjectType, const DetId &) const
std::vector< AxisSpecs > getBinningEB_(BinningType, bool) const
int ieta() const
get the crystal ieta
unsigned int offset(bool)
std::pair< unsigned, std::vector< int > > findBinsNoMap(ObjectType, BinningType, const DetId &) const
int pseudoStripId() const
get the tower id
int dccId() const
get the DCC (Ecal Local DCC value not global one) id
EcalDQMBinningService(const edm::ParameterSet &, edm::ActivityRegistry &)
const std::set< unsigned > dccNoMEM
const std::vector< int > * getBinMapEB_(BinningType) const
int iphi() const
get the tower iphi
T const * product() const
const std::vector< int > * getBinMapEBMEM_(BinningType) const
unsigned tccId(const DetId &)
unsigned ttId(const DetId &)
uint32_t idFromName(std::string const &) const
std::pair< unsigned, std::vector< int > > findBins(ObjectType, BinningType, const DetId &) const
void findBinsTriggerTower_(const DetId &, ObjectType, const std::vector< int > &, std::vector< int > &) const
const CaloGeometry * geometry_
std::vector< AxisSpecs > getBinningSM_(BinningType, bool, unsigned) const
Ecal trigger electronics identification [32:20] Unused (so far) [19:13] TCC id [12:6] TT id [5:3] pse...
std::pair< unsigned, std::vector< int > > cache_
tuple size
Write out results.
int smOffsetBins(ObjectType, BinningType, unsigned) const
void findBinsProjEta_(const DetId &, ObjectType, const std::vector< int > &, std::vector< int > &) const
std::vector< AxisSpecs > getBinningEEMEM_(BinningType, bool) const