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){
107 std::string nameID = rpcsrv.
name();
145 edm::LogInfo (
"rpcmonitordigi") <<
"[RPCMonitorDigi]: Beginning analyzing event " <<
counter;
150 std::map<RPCDetId , std::vector<RPCRecHit> > rechitMuon;
153 int numRPCRecHit = 0 ;
157 int nStaMuons = muonCands->size();
159 for(
int i = 0;
i < nStaMuons;
i++ ) {
168 std::vector<TrackingRecHitRef > rpcTrackRecHits;
171 if (!(*it)->isValid ())
continue;
172 int muSubDetId = (*it)->geographicalId().subdetId();
177 int detId = (int)rpcRecHit->
rpcId();
178 if(rechitMuon.find(detId) == rechitMuon.end() || rechitMuon[detId].size() == 0){
179 std::vector<RPCRecHit> myVect(1,*rpcRecHit );
180 rechitMuon[detId]= myVect;
182 rechitMuon[detId].push_back(*rpcRecHit);
193 edm::LogError (
"rpcmonitordigi") <<
"[RPCMonitorDigi]: Muons - Product not valid for event" <<
counter;
199 std::map<RPCDetId , std::vector<RPCRecHit> > rechitNoise;
206 std::vector<RPCRecHit>::const_iterator muonRecHitIter;
208 for (rpcRecHitIter = rpcHits->begin(); rpcRecHitIter != rpcHits->end() ; rpcRecHitIter++) {
210 int detId = (int)rpcRecHit.
rpcId();
211 if(rechitNoise.find(detId) == rechitNoise.end() || rechitNoise[detId].size() == 0){
212 std::vector<RPCRecHit> myVect(1,rpcRecHit );
213 rechitNoise[detId]= myVect;
215 rechitNoise[detId].push_back(rpcRecHit);
219 edm::LogError (
"rpcmonitordigi") <<
"[RPCMonitorDigi]: RPCRecHits - Product not valid for event" <<
counter;
233 edm::LogInfo (
"rpcmonitordigi") <<
"[RPCMonitorDigi]: Performing DQM source operations for ";
235 if(recHitMap.size()==0)
return;
237 std::map<std::string, std::map<std::string, MonitorElement*> > meRollCollection ;
238 std::map<std::string, MonitorElement*> meWheelDisk ;
239 std::map<std::string, MonitorElement*> meRegion ;
240 std::map<std::string, MonitorElement*> meSectorRing;
253 edm::LogWarning(
"rpcmonitordigi")<<
"[RPCMonitorDigi]: RecHit type not valid.";
258 int totalNumberOfRecHits[3] ={ 0, 0, 0};
259 std::stringstream os;
262 for (
std::map<
RPCDetId , std::vector<RPCRecHit> >::const_iterator detIdIter = recHitMap.begin(); detIdIter != recHitMap.end() ; detIdIter++){
264 RPCDetId detId = (*detIdIter).first;
273 std::string nameRoll =
"";
279 int region=(int)detId.
region();
280 int wheelOrDiskNumber;
281 std::string wheelOrDiskType;
283 int sector = detId.
sector();
286 int roll = detId.
roll();
288 wheelOrDiskType =
"Wheel";
289 wheelOrDiskNumber = (int)detId.
ring();
293 if(detId.
layer() == 1){
300 if(roll == 3) roll =2;
301 }
else if(station == 2){
302 if(detId.
layer() == 1){
304 if(
abs(wheelOrDiskNumber) ==2 && roll == 3) {
310 if(
abs(wheelOrDiskNumber) !=2 && roll == 3){
315 }
else if (station == 3){
318 if(roll == 3) roll =2;
322 if(roll == 3) roll =2;
326 wheelOrDiskType =
"Disk";
327 wheelOrDiskNumber = region*(int)detId.
station();
331 std::vector<RPCRecHit> recHits = (*detIdIter).second;
332 int numberOfRecHits = recHits.size();
333 totalNumberOfRecHits[region + 1 ] += numberOfRecHits;
335 std::set<int> bxSet ;
338 std::map<std::string, MonitorElement*> meMap = meRollCollection[nameRoll];
341 for(std::vector<RPCRecHit>::const_iterator recHitIter = recHits.begin(); recHitIter != recHits.end(); recHitIter++){
347 numDigi += clusterSize ;
349 int lastStrip = clusterSize + firstStrip - 1;
354 os<<
"Occupancy_"<<nameRoll;
355 if(meMap[os.str()]) {
356 for(
int s=firstStrip;
s<= lastStrip;
s++){
359 int nstrips = meMap[os.str()]->getNbinsX()/totalRolls;
360 meMap[os.str()]->Fill(
s + nstrips*(roll-1)); }
365 os<<
"BXDistribution_"<<nameRoll;
366 if(meMap[os.str()]) meMap[os.str()]->Fill(bx);
370 os<<
"ClusterSize_"<<nameRoll;
371 if(meMap[os.str()]) meMap[os.str()]->Fill(clusterSize);
379 os<<
"Occupancy_"<<wheelOrDiskType<<
"_"<<wheelOrDiskNumber<<
"_Sector_"<<sector;
380 if( meSectorRing[os.str()]){
381 for(
int s=firstStrip;
s<= lastStrip;
s++){
382 meSectorRing[os.str()]->Fill(
s, nr);
392 os<<
"Occupancy_"<<wheelOrDiskType<<
"_"<<wheelOrDiskNumber<<
"_Ring_"<<ring<<
"_CH01-CH18";
393 }
else if (geoServ.
segment() > 18 ){
394 os<<
"Occupancy_"<<wheelOrDiskType<<
"_"<<wheelOrDiskNumber<<
"_Ring_"<<ring<<
"_CH19-CH36";
397 if( meSectorRing[os.str()]){
398 for(
int s=firstStrip;
s<= lastStrip;
s++){
399 meSectorRing[os.str()]->Fill(
s + 32*(detId.
roll()-1), geoServ.
segment());
411 os<<
"1DOccupancy_Wheel_"<<wheelOrDiskNumber;
412 if( meWheelDisk[os.str()]) meWheelDisk[os.str()]->Fill(sector, clusterSize);
415 os<<
"Occupancy_Roll_vs_Sector_"<<wheelOrDiskType<<
"_"<<wheelOrDiskNumber;
416 if (meWheelDisk[os.str()]) meWheelDisk[os.str()]->Fill(sector, nr, clusterSize);
420 os<<
"1DOccupancy_Ring_"<<
ring;
421 if ((meWheelDisk[os.str()])){
422 if (wheelOrDiskNumber > 0 ) meWheelDisk[os.str()]->Fill(wheelOrDiskNumber +3, clusterSize);
423 else meWheelDisk[os.str()]->Fill(wheelOrDiskNumber + 4, clusterSize);
427 os<<
"Occupancy_Ring_vs_Segment_"<<wheelOrDiskType<<
"_"<<wheelOrDiskNumber;
428 if (meWheelDisk[os.str()]) meWheelDisk[os.str()]->Fill( geoServ.
segment(), (ring-1)*3-detId.
roll()+1,clusterSize );
432 os<<
"BxDistribution_"<<wheelOrDiskType<<
"_"<<wheelOrDiskNumber;
433 if(meWheelDisk[os.str()]) meWheelDisk[os.str()]->Fill(bx);
437 os<<
"ClusterSize_"<<wheelOrDiskType<<
"_"<<wheelOrDiskNumber<<
"_Layer"<<layer;
438 if(meWheelDisk[os.str()]) meWheelDisk[os.str()] ->
Fill(clusterSize);
442 os<<
"ClusterSize_"<<wheelOrDiskType<<
"_"<<wheelOrDiskNumber<<
"_Ring"<<
ring;
443 if(meWheelDisk[os.str()]) meWheelDisk[os.str()] ->
Fill(clusterSize);
451 if(meRegion[os.str()]) meRegion[os.str()] ->
Fill(clusterSize);
460 if(meRegion[os.str()]) meRegion[os.str()] ->
Fill(clusterSize);
466 os<<
"BXWithData_"<<nameRoll;
467 if(meMap[os.str()]) meMap[os.str()]->Fill(bxSet.size());
470 os<<
"NumberOfClusters_"<<nameRoll;
471 if(meMap[os.str()]) meMap[os.str()]->Fill( numberOfRecHits);
475 if(meRegion[os.str()]) meRegion[os.str()]->Fill(numDigi);
479 os<<
"Occupancy_for_Barrel";
480 if(meRegion[os.str()]) meRegion[os.str()]->Fill(sector, wheelOrDiskNumber, numDigi);
482 os<<
"Occupancy_for_Endcap";
483 int xbin = wheelOrDiskNumber+3;
484 if (region==-1) xbin = wheelOrDiskNumber+4;
485 if(meRegion[os.str()]) meRegion[os.str()]->Fill(xbin,ring,numDigi);
489 os<<
"Multiplicity_"<<nameRoll;
490 if(meMap[os.str()]) meMap[os.str()]->Fill(numDigi);
494 for(
int i = 0;
i< 3;
i++ ){
497 if(meRegion[os.str()]) meRegion[os.str()]->Fill( totalNumberOfRecHits[
i]);
507 if ( ! e.
getByLabel(
"scalersRawToDigi", dcsStatus) ){
519 for (DcsStatusCollection::const_iterator dcsStatusItr = dcsStatus->begin();
520 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)
std::map< std::string, MonitorElement * > wheelDiskMuonCollection
void save(const std::string &filename, const std::string &path="", const std::string &pattern="", const std::string &rewrite="", SaveReferenceTag ref=SaveWithReference, int minStatus=dqm::qstatus::STATUS_OK, const std::string &fileupdate="RECREATE")
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 &)
virtual double eta() const
momentum pseudorapidity
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
C::const_iterator const_iterator
constant access iterator type
static const std::string regionNames_[3]
Data Format.
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.
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
bool getByLabel(InputTag const &tag, Handle< PROD > &result) const
void endLuminosityBlock(edm::LuminosityBlock const &, edm::EventSetup const &)
virtual TrackRef outerTrack() const
reference to Track reconstructed in the muon detector only
MonitorElement * NumberOfRecHitMuon_
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)
virtual double pt() const
transverse momentum
int sector() const
Sector id: the group of chambers at same phi (and increasing r)
edm::InputTag rpcRecHitLabel_
void performSourceOperation(std::map< RPCDetId, std::vector< RPCRecHit > > &, std::string)
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.
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)
trackingRecHit_iterator recHitsEnd() const
Iterator to last hit on the track.
int region() const
Region id: 0 for Barrel, +/-1 For +/- Endcap.