23 numberOfInnerRings_(0){
52 edm::LogInfo (
"rpcmonitordigi") <<
"[RPCMonitorDigi]: Begin Run " ;
54 std::set<int> disk_set, ring_set;
59 edm::LogInfo (
"rpcmonitordigi") <<
"[RPCMonitorDigi]: Booking histograms per roll. " ;
60 for (TrackingGeometry::DetContainer::const_iterator it=rpcGeo->dets().begin();it<rpcGeo->dets().end();it++){
61 if(dynamic_cast< const RPCChamber* >( *it ) != 0 ){
63 std::vector< const RPCRoll*> roles = (ch->
rolls());
65 for(std::vector<const RPCRoll*>::const_iterator r = roles.begin();r != roles.end(); ++
r){
70 disk_set.insert(rpcId.
station());
71 ring_set.insert(rpcId.
ring());
87 disk_set.insert(rpcId.
station());
88 ring_set.insert(rpcId.
ring());
134 edm::LogInfo (
"rpcmonitordigi") <<
"[RPCMonitorDigi]: Beginning analyzing event " <<
counter;
141 std::map<RPCDetId , std::vector<RPCRecHit> > rechitMuon;
144 int numRPCRecHit = 0 ;
148 int nStaMuons = muonCands->size();
150 for(
int i = 0;
i < nStaMuons;
i++ ) {
159 std::vector<TrackingRecHitRef > rpcTrackRecHits;
162 if (!(*it)->isValid ())
continue;
163 int muSubDetId = (*it)->geographicalId().subdetId();
168 int detId = (int)rpcRecHit->
rpcId();
169 if(rechitMuon.find(detId) == rechitMuon.end() || rechitMuon[detId].size() == 0){
170 std::vector<RPCRecHit> myVect(1,*rpcRecHit );
171 rechitMuon[detId]= myVect;
173 rechitMuon[detId].push_back(*rpcRecHit);
184 edm::LogError (
"rpcmonitordigi") <<
"[RPCMonitorDigi]: Muons - Product not valid for event" <<
counter;
190 std::map<RPCDetId , std::vector<RPCRecHit> > rechitNoise;
197 std::vector<RPCRecHit>::const_iterator muonRecHitIter;
199 for (rpcRecHitIter = rpcHits->begin(); rpcRecHitIter != rpcHits->end() ; rpcRecHitIter++) {
201 int detId = (int)rpcRecHit.
rpcId();
202 if(rechitNoise.find(detId) == rechitNoise.end() || rechitNoise[detId].size() == 0){
203 std::vector<RPCRecHit> myVect(1,rpcRecHit );
204 rechitNoise[detId]= myVect;
206 rechitNoise[detId].push_back(rpcRecHit);
210 edm::LogError (
"rpcmonitordigi") <<
"[RPCMonitorDigi]: RPCRecHits - Product not valid for event" <<
counter;
224 edm::LogInfo (
"rpcmonitordigi") <<
"[RPCMonitorDigi]: Performing DQM source operations for ";
226 if(recHitMap.size()==0)
return;
228 std::map<std::string, std::map<std::string, MonitorElement*> > meRollCollection ;
229 std::map<std::string, MonitorElement*> meWheelDisk ;
230 std::map<std::string, MonitorElement*> meRegion ;
231 std::map<std::string, MonitorElement*> meSectorRing;
244 edm::LogWarning(
"rpcmonitordigi")<<
"[RPCMonitorDigi]: RecHit type not valid.";
249 int totalNumberOfRecHits[3] ={ 0, 0, 0};
250 std::stringstream os;
253 for (
std::map<
RPCDetId , std::vector<RPCRecHit> >::const_iterator detIdIter = recHitMap.begin(); detIdIter != recHitMap.end() ; detIdIter++){
255 RPCDetId detId = (*detIdIter).first;
270 int region=(int)detId.
region();
271 int wheelOrDiskNumber;
274 int sector = detId.
sector();
277 int roll = detId.
roll();
279 wheelOrDiskType =
"Wheel";
280 wheelOrDiskNumber = (int)detId.
ring();
284 if(detId.
layer() == 1){
291 if(roll == 3) roll =2;
292 }
else if(station == 2){
293 if(detId.
layer() == 1){
295 if(
abs(wheelOrDiskNumber) ==2 && roll == 3) {
301 if(
abs(wheelOrDiskNumber) !=2 && roll == 3){
306 }
else if (station == 3){
309 if(roll == 3) roll =2;
313 if(roll == 3) roll =2;
317 wheelOrDiskType =
"Disk";
318 wheelOrDiskNumber = region*(int)detId.
station();
322 std::vector<RPCRecHit> recHits = (*detIdIter).second;
323 int numberOfRecHits = recHits.size();
324 totalNumberOfRecHits[region + 1 ] += numberOfRecHits;
326 std::set<int> bxSet ;
329 std::map<std::string, MonitorElement*> meMap = meRollCollection[nameRoll];
332 for(std::vector<RPCRecHit>::const_iterator recHitIter = recHits.begin(); recHitIter != recHits.end(); recHitIter++){
338 numDigi += clusterSize ;
340 int lastStrip = clusterSize + firstStrip - 1;
345 os<<
"Occupancy_"<<nameRoll;
346 if(meMap[os.str()]) {
347 for(
int s=firstStrip;
s<= lastStrip;
s++){
350 int nstrips = meMap[os.str()]->getNbinsX()/totalRolls;
351 meMap[os.str()]->Fill(
s + nstrips*(roll-1)); }
356 os<<
"BXDistribution_"<<nameRoll;
357 if(meMap[os.str()]) meMap[os.str()]->Fill(bx);
361 os<<
"ClusterSize_"<<nameRoll;
362 if(meMap[os.str()]) meMap[os.str()]->Fill(clusterSize);
370 os<<
"Occupancy_"<<wheelOrDiskType<<
"_"<<wheelOrDiskNumber<<
"_Sector_"<<sector;
371 if( meSectorRing[os.str()]){
372 for(
int s=firstStrip;
s<= lastStrip;
s++){
373 meSectorRing[os.str()]->Fill(
s, nr);
383 os<<
"Occupancy_"<<wheelOrDiskType<<
"_"<<wheelOrDiskNumber<<
"_Ring_"<<ring<<
"_CH01-CH18";
384 }
else if (geoServ.
segment() > 18 ){
385 os<<
"Occupancy_"<<wheelOrDiskType<<
"_"<<wheelOrDiskNumber<<
"_Ring_"<<ring<<
"_CH19-CH36";
388 if( meSectorRing[os.str()]){
389 for(
int s=firstStrip;
s<= lastStrip;
s++){
390 meSectorRing[os.str()]->Fill(
s + 32*(detId.
roll()-1), geoServ.
segment());
402 os<<
"1DOccupancy_Wheel_"<<wheelOrDiskNumber;
403 if( meWheelDisk[os.str()]) meWheelDisk[os.str()]->Fill(sector, clusterSize);
406 os<<
"Occupancy_Roll_vs_Sector_"<<wheelOrDiskType<<
"_"<<wheelOrDiskNumber;
407 if (meWheelDisk[os.str()]) meWheelDisk[os.str()]->Fill(sector, nr, clusterSize);
411 os<<
"1DOccupancy_Ring_"<<
ring;
412 if ((meWheelDisk[os.str()])){
413 if (wheelOrDiskNumber > 0 ) meWheelDisk[os.str()]->Fill(wheelOrDiskNumber +3, clusterSize);
414 else meWheelDisk[os.str()]->Fill(wheelOrDiskNumber + 4, clusterSize);
418 os<<
"Occupancy_Ring_vs_Segment_"<<wheelOrDiskType<<
"_"<<wheelOrDiskNumber;
419 if (meWheelDisk[os.str()]) meWheelDisk[os.str()]->Fill( geoServ.
segment(), (ring-1)*3-detId.
roll()+1,clusterSize );
423 os<<
"BxDistribution_"<<wheelOrDiskType<<
"_"<<wheelOrDiskNumber;
424 if(meWheelDisk[os.str()]) meWheelDisk[os.str()]->Fill(bx);
428 os<<
"ClusterSize_"<<wheelOrDiskType<<
"_"<<wheelOrDiskNumber<<
"_Layer"<<layer;
429 if(meWheelDisk[os.str()]) meWheelDisk[os.str()] ->
Fill(clusterSize);
433 os<<
"ClusterSize_"<<wheelOrDiskType<<
"_"<<wheelOrDiskNumber<<
"_Ring"<<
ring;
434 if(meWheelDisk[os.str()]) meWheelDisk[os.str()] ->
Fill(clusterSize);
442 if(meRegion[os.str()]) meRegion[os.str()] ->
Fill(clusterSize);
451 if(meRegion[os.str()]) meRegion[os.str()] ->
Fill(clusterSize);
457 os<<
"BXWithData_"<<nameRoll;
458 if(meMap[os.str()]) meMap[os.str()]->Fill(bxSet.size());
461 os<<
"NumberOfClusters_"<<nameRoll;
462 if(meMap[os.str()]) meMap[os.str()]->Fill( numberOfRecHits);
466 if(meRegion[os.str()]) meRegion[os.str()]->Fill(numDigi);
470 os<<
"Occupancy_for_Barrel";
471 if(meRegion[os.str()]) meRegion[os.str()]->Fill(sector, wheelOrDiskNumber, numDigi);
473 os<<
"Occupancy_for_Endcap";
474 int xbin = wheelOrDiskNumber+3;
475 if (region==-1) xbin = wheelOrDiskNumber+4;
476 if(meRegion[os.str()]) meRegion[os.str()]->Fill(xbin,ring,numDigi);
480 os<<
"Multiplicity_"<<nameRoll;
481 if(meMap[os.str()]) meMap[os.str()]->Fill(numDigi);
485 for(
int i = 0;
i< 3;
i++ ){
488 if(meRegion[os.str()]) meRegion[os.str()]->Fill( totalNumberOfRecHits[
i]);
510 for (DcsStatusCollection::const_iterator dcsStatusItr = dcsStatus->begin();
511 dcsStatusItr != dcsStatus->end(); ++dcsStatusItr){
virtual std::string chambername()
T getParameter(std::string const &) const
std::map< std::string, MonitorElement * > regionMuonCollection
std::map< std::string, MonitorElement * > sectorRingNoiseCollection
int firstClusterStrip() const
T getUntrackedParameter(std::string const &, T const &) const
std::string globalFolder_
virtual float pt() const
transverse momentum
bool getByToken(EDGetToken token, Handle< PROD > &result) const
std::map< std::string, MonitorElement * > wheelDiskMuonCollection
std::map< std::string, MonitorElement * > regionNoiseCollection
bool isGlobalMuon() const
std::map< std::string, std::map< std::string, MonitorElement * > > meNoiseCollection
MonitorElement * muonRPCEvents_
void bookSectorRingME(DQMStore::IBooker &, const std::string &, std::map< std::string, MonitorElement * > &)
Booking of MonitoringElement at Sector/Ring level.
RPCMonitorDigi(const edm::ParameterSet &)
void makeDcsInfo(const edm::Event &)
std::map< std::string, MonitorElement * > wheelDiskNoiseCollection
static const std::string regionNames_[3]
Geometry.
RPCDetId rpcId() const
Return the rpcId.
virtual std::string name()
virtual void analyze(const edm::Event &, const edm::EventSetup &)
void Fill(HcalDetId &id, double val, std::vector< TH2F > &depth)
virtual float eta() const
momentum pseudorapidity
void bookRollME(DQMStore::IBooker &, RPCDetId &, const edm::EventSetup &, const std::string &, std::map< std::string, MonitorElement * > &)
Booking of MonitoringElement for one RPCDetId (= roll)
MonitorElement * book1D(Args &&...args)
const std::vector< const RPCRoll * > & rolls() const
Return the Rolls.
Abs< T >::type abs(const T &t)
trackingRecHit_iterator recHitsBegin() const
Iterator to first hit on the track.
How EventSelector::AcceptEvent() decides whether to accept an event for output otherwise it is excluding the probing of A single or multiple positive and the trigger will pass if any such matching triggers are PASS or EXCEPTION[A criterion thatmatches no triggers at all is detected and causes a throw.] A single negative with an expectation of appropriate bit checking in the decision and the trigger will pass if any such matching triggers are FAIL or EXCEPTION A wildcarded negative criterion that matches more than one trigger in the trigger but the state exists so we define the behavior If all triggers are the negative crieriion will lead to accepting the event(this again matches the behavior of"!*"before the partial wildcard feature was incorporated).The per-event"cost"of each negative criterion with multiple relevant triggers is about the same as!*was in the past
virtual TrackRef outerTrack() const
reference to Track reconstructed in the muon detector only
MonitorElement * NumberOfRecHitMuon_
virtual TrackingRecHit * clone() const =0
int detId2RollNr(const RPCDetId &_id)
void setCurrentFolder(const std::string &fullpath)
edm::EDGetTokenT< RPCRecHitCollection > rpcRecHitLabel_
edm::EDGetTokenT< DcsStatusCollection > scalersRawToDigiLabel_
int sector() const
Sector id: the group of chambers at same phi (and increasing r)
void performSourceOperation(std::map< RPCDetId, std::vector< RPCRecHit > > &, std::string)
void bookHistograms(DQMStore::IBooker &, edm::Run const &, edm::EventSetup const &) override
static std::atomic< unsigned int > counter
void bookWheelDiskME(DQMStore::IBooker &, const std::string &, std::map< std::string, MonitorElement * > &)
Booking of MonitoringElemnt at Wheel/Disk level.
MonitorElement * noiseRPCEvents_
std::map< std::string, MonitorElement * > sectorRingMuonCollection
volatile std::atomic< bool > shutdown_flag false
std::map< std::string, std::map< std::string, MonitorElement * > > meMuonCollection
void bookRegionME(DQMStore::IBooker &, const std::string &, std::map< std::string, MonitorElement * > &)
Booking of MonitoringElemnt at region (Barrel/Endcap) level.
MonitorElement * NumberOfMuon_
void setup(std::vector< TH2F > &depth, std::string name, std::string units="")
std::string subsystemFolder_
edm::EDGetTokenT< reco::CandidateView > muonLabel_
trackingRecHit_iterator recHitsEnd() const
Iterator to last hit on the track.
int region() const
Region id: 0 for Barrel, +/-1 For +/- Endcap.