CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
List of all members | Public Member Functions | Private Member Functions | Private Attributes
RPCMon_SS_Dbx_Global Class Reference

#include <RPCMon_SS_Dbx_Global.h>

Inheritance diagram for RPCMon_SS_Dbx_Global:
edm::EDAnalyzer

Public Member Functions

 RPCMon_SS_Dbx_Global (const edm::ParameterSet &)
 
 ~RPCMon_SS_Dbx_Global ()
 
- Public Member Functions inherited from edm::EDAnalyzer
 EDAnalyzer ()
 
std::string workerType () const
 
virtual ~EDAnalyzer ()
 

Private Member Functions

virtual void analyze (const edm::Event &, const edm::EventSetup &)
 
virtual void beginJob ()
 
void beginRun (const edm::Run &, const edm::EventSetup &)
 
virtual void endJob ()
 

Private Attributes

DQMStoredbe_
 
std::string digiLabel_
 
std::string globalFolder_
 
int numberOfRings_
 
std::string rootFileName_
 
bool saveRootFile_
 

Additional Inherited Members

- Public Types inherited from edm::EDAnalyzer
typedef EDAnalyzer ModuleType
 
typedef WorkerT< EDAnalyzerWorkerType
 
- Static Public Member Functions inherited from edm::EDAnalyzer
static const std::string & baseType ()
 
static void fillDescriptions (ConfigurationDescriptions &descriptions)
 
static void prevalidate (ConfigurationDescriptions &)
 
- Protected Member Functions inherited from edm::EDAnalyzer
CurrentProcessingContext const * currentContext () const
 

Detailed Description

Definition at line 15 of file RPCMon_SS_Dbx_Global.h.

Constructor & Destructor Documentation

RPCMon_SS_Dbx_Global::RPCMon_SS_Dbx_Global ( const edm::ParameterSet iConfig)
explicit

Definition at line 19 of file RPCMon_SS_Dbx_Global.cc.

References digiLabel_, edm::ParameterSet::getUntrackedParameter(), globalFolder_, numberOfRings_, rootFileName_, and saveRootFile_.

19  {
20 
21 
22  edm::LogVerbatim ("rpcmonitorerror") << "[RPCMon_SS_Dbx_Global]: Constructor";
23 
24 
25  globalFolder_ = iConfig.getUntrackedParameter<std::string>("GlobalHistogramsFolder","RPC/RecHits/SummaryHistograms");
26 
27  saveRootFile_ = iConfig.getUntrackedParameter<bool>("SaveRootFile", false);
28  rootFileName_ = iConfig.getUntrackedParameter<std::string>("RootFileName","out.root");
29  digiLabel_ = iConfig.getUntrackedParameter<std::string>("DigiLabel","muonRPCDigis");
30  numberOfRings_ = iConfig.getUntrackedParameter<int>("NumberOfEndcapRings", 2);
31 
32 }
T getUntrackedParameter(std::string const &, T const &) const
RPCMon_SS_Dbx_Global::~RPCMon_SS_Dbx_Global ( )

Definition at line 34 of file RPCMon_SS_Dbx_Global.cc.

References dbe_.

34  {
35  edm::LogVerbatim ("rpcmonitorerror") << "[RPCMon_SS_Dbx_Global]: Destructor ";
36  dbe_=0;
37 }

Member Function Documentation

void RPCMon_SS_Dbx_Global::analyze ( const edm::Event iEvent,
const edm::EventSetup iSetup 
)
privatevirtual

Implements edm::EDAnalyzer.

Definition at line 59 of file RPCMon_SS_Dbx_Global.cc.

References abs, DQMStore::book2D(), RPCGeomServ::chambernr(), dbe_, MonitorElement::Fill(), edm::EventSetup::get(), DQMStore::get(), edm::Event::getByType(), globalFolder_, rpcdqm::utils::labelXAxisSector(), rpcdqm::utils::labelXAxisSegment(), rpcdqm::utils::labelYAxisRing(), rpcdqm::utils::labelYAxisRoll(), RPCGeomServ::name(), mergeVDriftHistosByStation::name, RPCRoll::nstrips(), numberOfRings_, relativeConstraints::ring, RPCGeomServ::segment(), DQMStore::setCurrentFolder(), and GlobalPosition_Frontier_DevDB_cff::tag.

59  {
60 
62  iEvent.getByType(rpcDigis);
63 
65  iSetup.get<MuonGeometryRecord>().get( pDD );
66  rpcdqm::utils rpcUtils;
67 
69 
71 
72  // Loop over DetUnit's
73  for (detUnitIt=rpcDigis->begin();detUnitIt!=rpcDigis->end();++detUnitIt){
74  const RPCDetId& id = (*detUnitIt).first;
75  const RPCRoll* roll = dynamic_cast<const RPCRoll* >( pDD->roll(id));
76  const RPCDigiCollection::Range& range = (*detUnitIt).second;
77  // std::cout <<" detector "<< id.region()<< std::endl;
78  std::ostringstream tag;
79  std::ostringstream name;
80  MonitorElement* me;
81 
82  //get roll name
83  RPCGeomServ RPCname(id);
84  std::string nameRoll = RPCname.name();
85  //get roll number
86  RPCGeomServ RPCnumber(id);
87  int nr = RPCnumber.chambernr();
88  //get segment (valid only if endcap)
89  RPCGeomServ RPCsegment(id);
90  int seg = RPCsegment.segment();
91 
92  // Loop over the digis of this DetUnit
93  for (RPCDigiCollection::const_iterator digiIt = range.first;digiIt!=range.second;++digiIt) {
94  if (digiIt->strip() < 1 || digiIt->strip() > roll->nstrips() )
95  edm::LogVerbatim ("rpcmonitorerror") <<" XXXX Problem with detector "<< id << ", strip # " << digiIt->strip();
96  else { //Loop on digi2
97  for (RPCDigiCollection::const_iterator digiIt2 = digiIt; digiIt2!=range.second; ++digiIt2) {
98  int dstrip = digiIt->strip() - digiIt2->strip();
99  int dbx = digiIt->bx() - digiIt2->bx();
100  if ( dstrip == 0 && abs(dbx) != 0 ) {
101  // std::cout <<" detector 3333 "<< id.region()<<" " << id.ring()<<std::endl;
102  me = dbe_->get(globalFolder_ + "/AfterPulseBxDiff");
103  if(!me) continue;
104  me->Fill(dbx);
105 
106  if (id.region()!=0){//Endcap
107  name.str("");
108  tag.str("");
109  tag << "AfterPulse_Ring_vs_Segment_Disk_" << id.region()*id.station();
110  name << "Endcap, After Pulse, Diff bx, Disk # " << id.region()*id.station();
111  me = dbe_->get(globalFolder_ + "/"+tag.str());
112  if (!me){
113  me = dbe_->book2D (tag.str(),name.str(),36,0.5,36.5, 3*numberOfRings_, 0.0, 3*numberOfRings_);
114 
115  rpcUtils.labelXAxisSegment(me);
116  rpcUtils.labelYAxisRing(me, numberOfRings_, true);
117 
118  }
119  int yBin;
120  (numberOfRings_ == 3 ? yBin= id.ring()*3-id.roll()+1 : yBin= (id.ring()-1)*3-id.roll()+1);
121  me->Fill(seg, yBin);
122  } else { // Barrel ( region == 0 ).
123 
124  name.str("");
125  tag.str("");
126  tag << "AfterPulse_Roll_vs_Sector_Wheel_" << std::setw(2) << std::setfill('+') << id.ring();
127  name << "Barrel, After Pulse, Diff. bx, Wheel # " << std::setw(2) << std::setfill('+') << id.ring();
128  me = dbe_->get(globalFolder_ + "/"+tag.str());
129  if (!me){
130  me = dbe_->book2D (tag.str(),name.str(),12,0.5,12.5,21,0.5,21.5);
131  rpcUtils.labelXAxisSector( me);
132  rpcUtils.labelYAxisRoll(me, 0, id.ring(), true);
133  }
134  me->Fill(id.sector(),nr);
135  }//Barrel
136  }
137  }
138  }
139  }
140  }
141 }
int nstrips() const
Definition: RPCRoll.cc:46
#define abs(x)
Definition: mlp_lapack.h:159
void labelXAxisSegment(MonitorElement *myMe)
Definition: utils.h:251
void labelYAxisRoll(MonitorElement *myMe, int region, int ring, bool useRollInfo)
Definition: utils.h:269
bool getByType(Handle< PROD > &result) const
Definition: Event.h:398
void Fill(long long x)
void labelYAxisRing(MonitorElement *myMe, int numberOfRings, bool useRollInfo)
Definition: utils.h:296
MonitorElement * get(const std::string &path) const
get ME from full pathname (e.g. &quot;my/long/dir/my_histo&quot;)
Definition: DQMStore.cc:1468
void labelXAxisSector(MonitorElement *myMe)
Definition: utils.h:236
const T & get() const
Definition: EventSetup.h:55
std::vector< DigiType >::const_iterator const_iterator
std::pair< const_iterator, const_iterator > Range
MonitorElement * book2D(const char *name, const char *title, int nchX, double lowX, double highX, int nchY, double lowY, double highY)
Book 2D histogram.
Definition: DQMStore.cc:845
void setCurrentFolder(const std::string &fullpath)
Definition: DQMStore.cc:429
void RPCMon_SS_Dbx_Global::beginJob ( void  )
privatevirtual

Reimplemented from edm::EDAnalyzer.

Definition at line 39 of file RPCMon_SS_Dbx_Global.cc.

References dbe_, and cppFunctionSkipper::operator.

39  {
40  edm::LogVerbatim ("rpcmonitorerror") << "[RPCMon_SS_Dbx_Global]: Begin job ";
42 }
void RPCMon_SS_Dbx_Global::beginRun ( const edm::Run r,
const edm::EventSetup c 
)
privatevirtual

Reimplemented from edm::EDAnalyzer.

Definition at line 46 of file RPCMon_SS_Dbx_Global.cc.

References DQMStore::book1D(), dbe_, DQMStore::get(), MonitorElement::getName(), globalFolder_, DQMStore::removeElement(), and DQMStore::setCurrentFolder().

46  {
47  edm::LogVerbatim ("rpcmonitorerror") << "[RPCMon_SS_Dbx_Global]: Begin run";
48 
50 
51  MonitorElement* me;
52  me =0;
53  me = dbe_->get(globalFolder_ + "/AfterPulseBxDiff");
54  if ( 0!=me)
55  dbe_->removeElement(me->getName());
56  me = dbe_->book1D("AfterPulseBxDiff","After Pulse Bx Difference",13,-6.5,6.5);
57 }
const std::string & getName(void) const
get name of ME
MonitorElement * book1D(const char *name, const char *title, int nchX, double lowX, double highX)
Book 1D histogram.
Definition: DQMStore.cc:717
void removeElement(const std::string &name)
Definition: DQMStore.cc:2572
MonitorElement * get(const std::string &path) const
get ME from full pathname (e.g. &quot;my/long/dir/my_histo&quot;)
Definition: DQMStore.cc:1468
void setCurrentFolder(const std::string &fullpath)
Definition: DQMStore.cc:429
void RPCMon_SS_Dbx_Global::endJob ( void  )
privatevirtual

Reimplemented from edm::EDAnalyzer.

Definition at line 44 of file RPCMon_SS_Dbx_Global.cc.

44 {}

Member Data Documentation

DQMStore* RPCMon_SS_Dbx_Global::dbe_
private

Definition at line 30 of file RPCMon_SS_Dbx_Global.h.

Referenced by analyze(), beginJob(), beginRun(), and ~RPCMon_SS_Dbx_Global().

std::string RPCMon_SS_Dbx_Global::digiLabel_
private

Definition at line 27 of file RPCMon_SS_Dbx_Global.h.

Referenced by RPCMon_SS_Dbx_Global().

std::string RPCMon_SS_Dbx_Global::globalFolder_
private

Definition at line 27 of file RPCMon_SS_Dbx_Global.h.

Referenced by analyze(), beginRun(), and RPCMon_SS_Dbx_Global().

int RPCMon_SS_Dbx_Global::numberOfRings_
private

Definition at line 31 of file RPCMon_SS_Dbx_Global.h.

Referenced by analyze(), and RPCMon_SS_Dbx_Global().

std::string RPCMon_SS_Dbx_Global::rootFileName_
private

Definition at line 29 of file RPCMon_SS_Dbx_Global.h.

Referenced by RPCMon_SS_Dbx_Global().

bool RPCMon_SS_Dbx_Global::saveRootFile_
private

Definition at line 28 of file RPCMon_SS_Dbx_Global.h.

Referenced by RPCMon_SS_Dbx_Global().