51 edm::LogInfo (
"rpcmonitordigi") <<
"[RPCMonitorDigi]: Begin Run " ;
97 edm::LogInfo (
"rpcmonitordigi") <<
"[RPCMonitorDigi]: Booking histograms per roll. " ;
98 for (TrackingGeometry::DetContainer::const_iterator it=rpcGeo->dets().begin();it<rpcGeo->dets().end();it++){
99 if(dynamic_cast< RPCChamber* >( *it ) != 0 ){
101 std::vector< const RPCRoll*> roles = (ch->
rolls());
103 for(std::vector<const RPCRoll*>::const_iterator r = roles.begin();r != roles.end(); ++
r){
144 edm::LogInfo (
"rpcmonitordigi") <<
"[RPCMonitorDigi]: Beginning analyzing event " <<
counter;
151 std::map<RPCDetId , std::vector<RPCRecHit> > rechitMuon;
154 int numRPCRecHit = 0 ;
158 int nStaMuons = muonCands->size();
160 for(
int i = 0;
i < nStaMuons;
i++ ) {
169 std::vector<TrackingRecHitRef > rpcTrackRecHits;
172 if (!(*it)->isValid ())
continue;
173 int muSubDetId = (*it)->geographicalId().subdetId();
178 int detId = (int)rpcRecHit->
rpcId();
179 if(rechitMuon.find(detId) == rechitMuon.end() || rechitMuon[detId].size() == 0){
180 std::vector<RPCRecHit> myVect(1,*rpcRecHit );
181 rechitMuon[detId]= myVect;
183 rechitMuon[detId].push_back(*rpcRecHit);
194 edm::LogError (
"rpcmonitordigi") <<
"[RPCMonitorDigi]: Muons - Product not valid for event" <<
counter;
200 std::map<RPCDetId , std::vector<RPCRecHit> > rechitNoise;
207 std::vector<RPCRecHit>::const_iterator muonRecHitIter;
209 for (rpcRecHitIter = rpcHits->begin(); rpcRecHitIter != rpcHits->end() ; rpcRecHitIter++) {
211 int detId = (int)rpcRecHit.
rpcId();
212 if(rechitNoise.find(detId) == rechitNoise.end() || rechitNoise[detId].size() == 0){
213 std::vector<RPCRecHit> myVect(1,rpcRecHit );
214 rechitNoise[detId]= myVect;
216 rechitNoise[detId].push_back(rpcRecHit);
220 edm::LogError (
"rpcmonitordigi") <<
"[RPCMonitorDigi]: RPCRecHits - Product not valid for event" <<
counter;
234 edm::LogInfo (
"rpcmonitordigi") <<
"[RPCMonitorDigi]: Performing DQM source operations for ";
236 if(recHitMap.size()==0)
return;
238 std::map<std::string, std::map<std::string, MonitorElement*> > meRollCollection ;
239 std::map<std::string, MonitorElement*> meWheelDisk ;
240 std::map<std::string, MonitorElement*> meRegion ;
241 std::map<std::string, MonitorElement*> meSectorRing;
254 edm::LogWarning(
"rpcmonitordigi")<<
"[RPCMonitorDigi]: RecHit type not valid.";
259 int totalNumberOfRecHits[3] ={ 0, 0, 0};
260 std::stringstream os;
263 for (
std::map<
RPCDetId , std::vector<RPCRecHit> >::const_iterator detIdIter = recHitMap.begin(); detIdIter != recHitMap.end() ; detIdIter++){
265 RPCDetId detId = (*detIdIter).first;
280 int region=(int)detId.
region();
281 int wheelOrDiskNumber;
284 int sector = detId.
sector();
287 int roll = detId.
roll();
289 wheelOrDiskType =
"Wheel";
290 wheelOrDiskNumber = (int)detId.
ring();
294 if(detId.
layer() == 1){
301 if(roll == 3) roll =2;
302 }
else if(station == 2){
303 if(detId.
layer() == 1){
305 if(
abs(wheelOrDiskNumber) ==2 && roll == 3) {
311 if(
abs(wheelOrDiskNumber) !=2 && roll == 3){
316 }
else if (station == 3){
319 if(roll == 3) roll =2;
323 if(roll == 3) roll =2;
327 wheelOrDiskType =
"Disk";
328 wheelOrDiskNumber = region*(int)detId.
station();
332 std::vector<RPCRecHit> recHits = (*detIdIter).second;
333 int numberOfRecHits = recHits.size();
334 totalNumberOfRecHits[region + 1 ] += numberOfRecHits;
336 std::set<int> bxSet ;
339 std::map<std::string, MonitorElement*> meMap = meRollCollection[nameRoll];
342 for(std::vector<RPCRecHit>::const_iterator recHitIter = recHits.begin(); recHitIter != recHits.end(); recHitIter++){
348 numDigi += clusterSize ;
350 int lastStrip = clusterSize + firstStrip - 1;
355 os<<
"Occupancy_"<<nameRoll;
356 if(meMap[os.str()]) {
357 for(
int s=firstStrip;
s<= lastStrip;
s++){
360 int nstrips = meMap[os.str()]->getNbinsX()/totalRolls;
361 meMap[os.str()]->Fill(
s + nstrips*(roll-1)); }
366 os<<
"BXDistribution_"<<nameRoll;
367 if(meMap[os.str()]) meMap[os.str()]->Fill(bx);
371 os<<
"ClusterSize_"<<nameRoll;
372 if(meMap[os.str()]) meMap[os.str()]->Fill(clusterSize);
380 os<<
"Occupancy_"<<wheelOrDiskType<<
"_"<<wheelOrDiskNumber<<
"_Sector_"<<sector;
381 if( meSectorRing[os.str()]){
382 for(
int s=firstStrip;
s<= lastStrip;
s++){
383 meSectorRing[os.str()]->Fill(
s, nr);
393 os<<
"Occupancy_"<<wheelOrDiskType<<
"_"<<wheelOrDiskNumber<<
"_Ring_"<<ring<<
"_CH01-CH18";
394 }
else if (geoServ.
segment() > 18 ){
395 os<<
"Occupancy_"<<wheelOrDiskType<<
"_"<<wheelOrDiskNumber<<
"_Ring_"<<ring<<
"_CH19-CH36";
398 if( meSectorRing[os.str()]){
399 for(
int s=firstStrip;
s<= lastStrip;
s++){
400 meSectorRing[os.str()]->Fill(
s + 32*(detId.
roll()-1), geoServ.
segment());
412 os<<
"1DOccupancy_Wheel_"<<wheelOrDiskNumber;
413 if( meWheelDisk[os.str()]) meWheelDisk[os.str()]->Fill(sector, clusterSize);
416 os<<
"Occupancy_Roll_vs_Sector_"<<wheelOrDiskType<<
"_"<<wheelOrDiskNumber;
417 if (meWheelDisk[os.str()]) meWheelDisk[os.str()]->Fill(sector, nr, clusterSize);
421 os<<
"1DOccupancy_Ring_"<<
ring;
422 if ((meWheelDisk[os.str()])){
423 if (wheelOrDiskNumber > 0 ) meWheelDisk[os.str()]->Fill(wheelOrDiskNumber +3, clusterSize);
424 else meWheelDisk[os.str()]->Fill(wheelOrDiskNumber + 4, clusterSize);
428 os<<
"Occupancy_Ring_vs_Segment_"<<wheelOrDiskType<<
"_"<<wheelOrDiskNumber;
429 if (meWheelDisk[os.str()]) meWheelDisk[os.str()]->Fill( geoServ.
segment(), (ring-1)*3-detId.
roll()+1,clusterSize );
433 os<<
"BxDistribution_"<<wheelOrDiskType<<
"_"<<wheelOrDiskNumber;
434 if(meWheelDisk[os.str()]) meWheelDisk[os.str()]->Fill(bx);
438 os<<
"ClusterSize_"<<wheelOrDiskType<<
"_"<<wheelOrDiskNumber<<
"_Layer"<<layer;
439 if(meWheelDisk[os.str()]) meWheelDisk[os.str()] ->
Fill(clusterSize);
443 os<<
"ClusterSize_"<<wheelOrDiskType<<
"_"<<wheelOrDiskNumber<<
"_Ring"<<
ring;
444 if(meWheelDisk[os.str()]) meWheelDisk[os.str()] ->
Fill(clusterSize);
452 if(meRegion[os.str()]) meRegion[os.str()] ->
Fill(clusterSize);
461 if(meRegion[os.str()]) meRegion[os.str()] ->
Fill(clusterSize);
467 os<<
"BXWithData_"<<nameRoll;
468 if(meMap[os.str()]) meMap[os.str()]->Fill(bxSet.size());
471 os<<
"NumberOfClusters_"<<nameRoll;
472 if(meMap[os.str()]) meMap[os.str()]->Fill( numberOfRecHits);
476 if(meRegion[os.str()]) meRegion[os.str()]->Fill(numDigi);
480 os<<
"Occupancy_for_Barrel";
481 if(meRegion[os.str()]) meRegion[os.str()]->Fill(sector, wheelOrDiskNumber, numDigi);
483 os<<
"Occupancy_for_Endcap";
484 int xbin = wheelOrDiskNumber+3;
485 if (region==-1) xbin = wheelOrDiskNumber+4;
486 if(meRegion[os.str()]) meRegion[os.str()]->Fill(xbin,ring,numDigi);
490 os<<
"Multiplicity_"<<nameRoll;
491 if(meMap[os.str()]) meMap[os.str()]->Fill(numDigi);
495 for(
int i = 0;
i< 3;
i++ ){
498 if(meRegion[os.str()]) meRegion[os.str()]->Fill( totalNumberOfRecHits[
i]);
520 for (DcsStatusCollection::const_iterator dcsStatusItr = dcsStatus->begin();
521 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
const std::string & getName(void) const
get name of ME
std::string globalFolder_
MonitorElement * book1D(const char *name, const char *title, int nchX, double lowX, double highX)
Book 1D histogram.
virtual void endJob(void)
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_
RPCMonitorDigi(const edm::ParameterSet &)
void makeDcsInfo(const edm::Event &)
void bookRollME(RPCDetId &, const edm::EventSetup &, const std::string &, std::map< std::string, MonitorElement * > &)
Booking of MonitoringElement for one RPCDetId (= roll)
std::map< std::string, MonitorElement * > wheelDiskNoiseCollection
static const std::string regionNames_[3]
Geometry.
RPCDetId rpcId() const
Return the rpcId.
virtual std::string name()
void beginRun(const edm::Run &r, const edm::EventSetup &c)
virtual void analyze(const edm::Event &, const edm::EventSetup &)
void Fill(HcalDetId &id, double val, std::vector< TH2F > &depth)
void removeElement(const std::string &name)
const std::vector< const RPCRoll * > & rolls() const
Return the Rolls.
Abs< T >::type abs(const T &t)
void save(const std::string &filename, const std::string &path="", const std::string &pattern="", const std::string &rewrite="", const uint32_t run=0, SaveReferenceTag ref=SaveWithReference, int minStatus=dqm::qstatus::STATUS_OK, const std::string &fileupdate="RECREATE")
trackingRecHit_iterator recHitsBegin() const
Iterator to first hit on the track.
MonitorElement * get(const std::string &path) const
get ME from full pathname (e.g. "my/long/dir/my_histo")
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
void endLuminosityBlock(edm::LuminosityBlock const &, edm::EventSetup const &)
virtual TrackRef outerTrack() const
reference to Track reconstructed in the muon detector only
MonitorElement * NumberOfRecHitMuon_
virtual float eta() const GCC11_FINAL
momentum pseudorapidity
virtual TrackingRecHit * clone() const =0
void bookWheelDiskME(const std::string &, std::map< std::string, MonitorElement * > &)
Booking of MonitoringElemnt at Wheel/Disk level.
int detId2RollNr(const RPCDetId &_id)
edm::EDGetTokenT< RPCRecHitCollection > rpcRecHitLabel_
edm::EDGetTokenT< DcsStatusCollection > scalersRawToDigiLabel_
int sector() const
Sector id: the group of chambers at same phi (and increasing r)
return(e1-e2)*(e1-e2)+dp *dp
void performSourceOperation(std::map< RPCDetId, std::vector< RPCRecHit > > &, std::string)
static std::atomic< unsigned int > counter
MonitorElement * noiseRPCEvents_
std::map< std::string, MonitorElement * > sectorRingMuonCollection
std::map< std::string, std::map< std::string, MonitorElement * > > meMuonCollection
void bookSectorRingME(const std::string &, std::map< std::string, MonitorElement * > &)
Booking of MonitoringElement at Sector/Ring level.
virtual float pt() const GCC11_FINAL
transverse momentum
void bookRegionME(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_
void setCurrentFolder(const std::string &fullpath)
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.