CMS 3D CMS Logo

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

#include <RPCDigiValid.h>

Inheritance diagram for RPCDigiValid:
edm::EDAnalyzer

Public Member Functions

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

Protected Member Functions

void analyze (const edm::Event &e, const edm::EventSetup &c)
 
void beginJob ()
 
void endJob (void)
 
- Protected Member Functions inherited from edm::EDAnalyzer
CurrentProcessingContext const * currentContext () const
 

Private Attributes

MonitorElementBxDist
 
DQMStoredbe_
 
std::string digiLabel
 
std::string outputFile_
 
MonitorElementRes
 
MonitorElementResWmin1
 
MonitorElementResWmin2
 
MonitorElementResWplu1
 
MonitorElementResWplu2
 
MonitorElementResWzer0
 
MonitorElementrzview
 
MonitorElementStripProf
 
MonitorElementxyview
 

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)
 

Detailed Description

Definition at line 24 of file RPCDigiValid.h.

Constructor & Destructor Documentation

RPCDigiValid::RPCDigiValid ( const edm::ParameterSet ps)

Definition at line 19 of file RPCDigiValid.cc.

References BxDist, dbe_, digiLabel, edm::ParameterSet::getUntrackedParameter(), cmsCodeRules.cppFunctionSkipper::operator, outputFile_, Res, ResWmin1, ResWmin2, ResWplu1, ResWplu2, ResWzer0, rzview, StripProf, and xyview.

19  :dbe_(0){
20 
21  digiLabel = ps.getUntrackedParameter<std::string>("digiLabel");
22  outputFile_ = ps.getUntrackedParameter<string>("outputFile", "rpcDigiValidPlots.root");
24 
25  if ( dbe_ ) {
26  dbe_->setCurrentFolder("RPCDigisV/RPCDigis");
27 
28  xyview = dbe_->book2D("X Vs Y View","X Vs Y View",1000, -700., 700., 1000, -700., 700.);
29  rzview = dbe_->book2D("R Vs Z View","X Vs Y View",1000, -1100., 1100.,1000,0., 700.);
30  Res = dbe_->book1D("Digi SimHit difference", "Digi SimHit Difference", 300, -8, 8);
31  ResWmin2 = dbe_->book1D("W-2 Residuals", "Residuals for Wheel -2", 300, -8, 8);
32  ResWmin1 = dbe_->book1D("W-1 Residuals", "Residuals for Wheel -1", 300, -8, 8);
33  ResWzer0 = dbe_->book1D("W 0 Residuals", "Residuals for Wheel 0", 300, -8, 8);
34  ResWplu1 = dbe_->book1D("W+1 Residuals", "Residuals for Wheel +1", 300, -8, 8);
35  ResWplu2 = dbe_->book1D("W+2 Residuals", "Residuals for Wheel +2", 300, -8, 8);
36 
37  BxDist = dbe_->book1D("Bunch Crossing", "Bunch Crossing", 20, -9.5, 9.5);
38  StripProf = dbe_->book1D("Strip Profile", "Strip Profile", 100, 0, 100);
39  }
40 }
T getUntrackedParameter(std::string const &, T const &) const
MonitorElement * book1D(const char *name, const char *title, int nchX, double lowX, double highX)
Book 1D histogram.
Definition: DQMStore.cc:519
MonitorElement * ResWplu2
Definition: RPCDigiValid.h:45
DQMStore * dbe_
Definition: RPCDigiValid.h:49
MonitorElement * StripProf
Definition: RPCDigiValid.h:47
MonitorElement * Res
Definition: RPCDigiValid.h:40
MonitorElement * ResWzer0
Definition: RPCDigiValid.h:43
std::string outputFile_
Definition: RPCDigiValid.h:50
MonitorElement * ResWmin1
Definition: RPCDigiValid.h:42
MonitorElement * ResWplu1
Definition: RPCDigiValid.h:44
MonitorElement * ResWmin2
Definition: RPCDigiValid.h:41
MonitorElement * BxDist
Definition: RPCDigiValid.h:46
std::string digiLabel
Definition: RPCDigiValid.h:51
MonitorElement * xyview
Definition: RPCDigiValid.h:38
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:647
void setCurrentFolder(const std::string &fullpath)
Definition: DQMStore.cc:237
MonitorElement * rzview
Definition: RPCDigiValid.h:39
RPCDigiValid::~RPCDigiValid ( )

Definition at line 42 of file RPCDigiValid.cc.

42 {}

Member Function Documentation

void RPCDigiValid::analyze ( const edm::Event e,
const edm::EventSetup c 
)
protectedvirtual

Implements edm::EDAnalyzer.

Definition at line 50 of file RPCDigiValid.cc.

References BxDist, RPCRoll::centreOfStrip(), digiLabel, MonitorElement::Fill(), edm::EventSetup::get(), L1TEmulatorMonitor_cff::p, PV3DBase< T, PVType, FrameType >::perp(), RPCDetId::region(), Res, ResWmin1, ResWmin2, ResWplu1, ResWplu2, ResWzer0, RPCDetId::ring(), RPCDetId, rzview, StripProf, GeomDet::toGlobal(), PV3DBase< T, PVType, FrameType >::x(), ExpressReco_HICollisions_FallBack::x, xyview, PV3DBase< T, PVType, FrameType >::y(), and PV3DBase< T, PVType, FrameType >::z().

50  {
51 
52  // cout << endl <<"--- [RPCDigiQuality] Analysing Event: #Run: " << event.id().run()
53  // << " #Event: " << event.id().event() << endl;
54 
55  // Get the RPC Geometry
57  eventSetup.get<MuonGeometryRecord>().get(rpcGeom);
58 
60  event.getByLabel("g4SimHits", "MuonRPCHits", simHit);
61 
63  event.getByLabel(digiLabel, rpcDigis);
64 
65  // Loop on simhits
66  PSimHitContainer::const_iterator simIt;
67 
68  //loop over Simhit
69  std::map<RPCDetId, std::vector<double> > allsims;
70 
71  for (simIt = simHit->begin(); simIt != simHit->end(); simIt++) {
72  RPCDetId Rsid = (RPCDetId)(*simIt).detUnitId();
73  const RPCRoll* soll = dynamic_cast<const RPCRoll* >( rpcGeom->roll(Rsid));
74  int ptype = simIt->particleType();
75 
76  // std::cout <<"This is a Simhit with Parent "<<ptype<<std::endl;
77  if (ptype == 13 || ptype == -13) {
78  std::vector<double> buff;
79  if (allsims.find(Rsid) != allsims.end() ){
80  buff= allsims[Rsid];
81  }
82  buff.push_back(simIt->localPosition().x());
83  allsims[Rsid]=buff;
84  }
85  GlobalPoint p=soll->toGlobal(simIt->localPosition());
86  /*
87  std::cout <<"Muon Position phi="<<p.phi()
88  <<" R="<<p.perp()
89  <<" z="<<p.z()<<std::endl;
90  */
91  xyview->Fill(p.x(),p.y());
92  rzview->Fill(p.z(),p.perp());
93 
94  }
95  //loop over Digis
97  for (detUnitIt=rpcDigis->begin(); detUnitIt!=rpcDigis->end();++detUnitIt){
98  const RPCDetId Rsid = (*detUnitIt).first;
99  const RPCRoll* roll = dynamic_cast<const RPCRoll* >( rpcGeom->roll(Rsid));
100  const RPCDigiCollection::Range& range = (*detUnitIt).second;
101  std::vector<double> sims;
102  if (allsims.find(Rsid) != allsims.end() ){
103  sims = allsims[Rsid];
104  }
105  int ndigi=0;
106  for (RPCDigiCollection::const_iterator digiIt = range.first;
107  digiIt != range.second; ++digiIt){
108  StripProf->Fill(digiIt->strip());
109  BxDist->Fill(digiIt->bx());
110  ndigi++;
111  }
112 
113 
114  // std::cout<<" Number of Digi "<<ndigi<<" for "<<Rsid<<std::endl;
115 
116  if (sims.size() == 1 && ndigi == 1){
117  double dis = roll->centreOfStrip(range.first->strip()).x()-sims[0];
118  Res->Fill(dis);
119 
120  if (Rsid.region() == 0 ){
121  if (Rsid.ring() == -2)
122  ResWmin2->Fill(dis);
123  else if (Rsid.ring() == -1)
124  ResWmin1->Fill(dis);
125  else if (Rsid.ring() == 0)
126  ResWzer0->Fill(dis);
127  else if (Rsid.ring() == 1)
128  ResWplu1->Fill(dis);
129  else if (Rsid.ring() == 2)
130  ResWplu2->Fill(dis);
131  }
132  }
133  }
134 }
LocalPoint centreOfStrip(int strip) const
Definition: RPCRoll.cc:52
T perp() const
Definition: PV3DBase.h:66
GlobalPoint toGlobal(const Local2DPoint &lp) const
Conversion to the global R.F. from the R.F. of the GeomDet.
Definition: GeomDet.h:49
T y() const
Definition: PV3DBase.h:57
MonitorElement * ResWplu2
Definition: RPCDigiValid.h:45
MonitorElement * StripProf
Definition: RPCDigiValid.h:47
MonitorElement * Res
Definition: RPCDigiValid.h:40
MonitorElement * ResWzer0
Definition: RPCDigiValid.h:43
void Fill(long long x)
MonitorElement * ResWmin1
Definition: RPCDigiValid.h:42
int ring() const
Definition: RPCDetId.h:74
MonitorElement * ResWplu1
Definition: RPCDigiValid.h:44
T z() const
Definition: PV3DBase.h:58
MonitorElement * ResWmin2
Definition: RPCDigiValid.h:41
std::vector< DigiType >::const_iterator const_iterator
MonitorElement * BxDist
Definition: RPCDigiValid.h:46
std::pair< const_iterator, const_iterator > Range
std::string digiLabel
Definition: RPCDigiValid.h:51
MonitorElement * xyview
Definition: RPCDigiValid.h:38
T x() const
Definition: PV3DBase.h:56
MonitorElement * rzview
Definition: RPCDigiValid.h:39
int region() const
Region id: 0 for Barrel, +/-1 For +/- Endcap.
Definition: RPCDetId.h:65
void RPCDigiValid::beginJob ( void  )
protectedvirtual

Reimplemented from edm::EDAnalyzer.

Definition at line 44 of file RPCDigiValid.cc.

44 {}
void RPCDigiValid::endJob ( void  )
protectedvirtual

Reimplemented from edm::EDAnalyzer.

Definition at line 46 of file RPCDigiValid.cc.

References dbe_, outputFile_, and DQMStore::save().

46  {
47  if ( outputFile_.size() != 0 && dbe_ ) dbe_->save(outputFile_);
48 }
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")
Definition: DQMStore.cc:1883
DQMStore * dbe_
Definition: RPCDigiValid.h:49
std::string outputFile_
Definition: RPCDigiValid.h:50

Member Data Documentation

MonitorElement* RPCDigiValid::BxDist
private

Definition at line 46 of file RPCDigiValid.h.

Referenced by analyze(), and RPCDigiValid().

DQMStore* RPCDigiValid::dbe_
private

Definition at line 49 of file RPCDigiValid.h.

Referenced by endJob(), and RPCDigiValid().

std::string RPCDigiValid::digiLabel
private

Definition at line 51 of file RPCDigiValid.h.

Referenced by analyze(), and RPCDigiValid().

std::string RPCDigiValid::outputFile_
private

Definition at line 50 of file RPCDigiValid.h.

Referenced by endJob(), and RPCDigiValid().

MonitorElement* RPCDigiValid::Res
private

Definition at line 40 of file RPCDigiValid.h.

Referenced by analyze(), and RPCDigiValid().

MonitorElement* RPCDigiValid::ResWmin1
private

Definition at line 42 of file RPCDigiValid.h.

Referenced by analyze(), and RPCDigiValid().

MonitorElement* RPCDigiValid::ResWmin2
private

Definition at line 41 of file RPCDigiValid.h.

Referenced by analyze(), and RPCDigiValid().

MonitorElement* RPCDigiValid::ResWplu1
private

Definition at line 44 of file RPCDigiValid.h.

Referenced by analyze(), and RPCDigiValid().

MonitorElement* RPCDigiValid::ResWplu2
private

Definition at line 45 of file RPCDigiValid.h.

Referenced by analyze(), and RPCDigiValid().

MonitorElement* RPCDigiValid::ResWzer0
private

Definition at line 43 of file RPCDigiValid.h.

Referenced by analyze(), and RPCDigiValid().

MonitorElement* RPCDigiValid::rzview
private

Definition at line 39 of file RPCDigiValid.h.

Referenced by analyze(), and RPCDigiValid().

MonitorElement* RPCDigiValid::StripProf
private

Definition at line 47 of file RPCDigiValid.h.

Referenced by analyze(), and RPCDigiValid().

MonitorElement* RPCDigiValid::xyview
private

Definition at line 38 of file RPCDigiValid.h.

Referenced by analyze(), and RPCDigiValid().