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
 
MonitorElementResDmin1
 
MonitorElementResDmin2
 
MonitorElementResDmin3
 
MonitorElementResDplu1
 
MonitorElementResDplu2
 
MonitorElementResDplu3
 
MonitorElementResWmin1
 
MonitorElementResWmin2
 
MonitorElementResWplu1
 
MonitorElementResWplu2
 
MonitorElementResWzer0
 
MonitorElementrzview
 
MonitorElementStripProf
 
MonitorElementxyvDmin1
 
MonitorElementxyvDmin2
 
MonitorElementxyvDmin3
 
MonitorElementxyvDplu1
 
MonitorElementxyvDplu2
 
MonitorElementxyvDplu3
 
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, ResDmin1, ResDmin2, ResDmin3, ResDplu1, ResDplu2, ResDplu3, ResWmin1, ResWmin2, ResWplu1, ResWplu2, ResWzer0, rzview, StripProf, xyvDmin1, xyvDmin2, xyvDmin3, xyvDplu1, xyvDplu2, xyvDplu3, 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, -760., 760., 1000, -760., 760.);
29 
30  xyvDplu1 = dbe_->book2D("Dplu1_XvsY","Dplu1_XvsY",1000, -760., 760., 1000, -760., 760.);
31  xyvDplu2 = dbe_->book2D("Dplu2_XvsY","Dplu2_XvsY",1000, -760., 760., 1000, -760., 760.);
32  xyvDplu3 = dbe_->book2D("Dplu3_XvsY","Dplu3_XvsY",1000, -760., 760., 1000, -760., 760.);
33  xyvDmin1 = dbe_->book2D("Dmin1_XvsY","Dmin1_XvsY",1000, -760., 760., 1000, -760., 760.);
34  xyvDmin2 = dbe_->book2D("Dmin2_XvsY","Dmin2_XvsY",1000, -760., 760., 1000, -760., 760.);
35  xyvDmin3 = dbe_->book2D("Dmin3_XvsY","Dmin3_XvsY",1000, -760., 760., 1000, -760., 760.);
36 
37  rzview = dbe_->book2D("R_Vs_Z_View","R_Vs_Z_View",1000, -1100., 1100.,1000,0., 800.);
38  Res = dbe_->book1D("Digi_SimHit_difference", "Digi_SimHit_difference", 300, -8, 8);
39  ResWmin2 = dbe_->book1D("W_Min2_Residuals", "W_Min2_Residuals", 300, -8, 8);
40  ResWmin1 = dbe_->book1D("W_Min1_Residuals", "W_Min1_Residuals", 300, -8, 8);
41  ResWzer0 = dbe_->book1D("W_Zer0_Residuals", "W_Zer0_Residuals", 300, -8, 8);
42  ResWplu1 = dbe_->book1D("W_Plu1_Residuals", "W_Plu1_Residuals", 300, -8, 8);
43  ResWplu2 = dbe_->book1D("W_Plu2_Residuals", "W_Plu2_Residuals", 300, -8, 8);
44 
45  BxDist = dbe_->book1D("Bunch_Crossing", "Bunch_Crossing", 20, -10., 10.);
46  StripProf = dbe_->book1D("Strip_Profile", "Strip_Profile", 100, 0, 100);
47 
48  ResDmin1 = dbe_->book1D("Disk_Min1_Residuals", "Disk_Min1_Residuals", 300, -8, 8);
49  ResDmin2 = dbe_->book1D("Disk_Min2_Residuals", "Disk_Min2_Residuals", 300, -8, 8);
50  ResDmin3 = dbe_->book1D("Disk_Min3_Residuals", "Disk_Min3_Residuals", 300, -8, 8);
51  ResDplu1 = dbe_->book1D("Disk_Plu1_Residuals", "Disk_Plu1_Residuals", 300, -8, 8);
52  ResDplu2 = dbe_->book1D("Disk_Plu2_Residuals", "Disk_Plu2_Residuals", 300, -8, 8);
53  ResDplu3 = dbe_->book1D("Disk_Plu3_Residuals", "Disk_Plu3_Residuals", 300, -8, 8);
54 
55  }
56 }
T getUntrackedParameter(std::string const &, T const &) const
MonitorElement * xyvDmin2
Definition: RPCDigiValid.h:63
MonitorElement * book1D(const char *name, const char *title, int nchX, double lowX, double highX)
Book 1D histogram.
Definition: DQMStore.cc:514
MonitorElement * ResWplu2
Definition: RPCDigiValid.h:45
DQMStore * dbe_
Definition: RPCDigiValid.h:66
MonitorElement * xyvDplu3
Definition: RPCDigiValid.h:60
MonitorElement * StripProf
Definition: RPCDigiValid.h:47
MonitorElement * Res
Definition: RPCDigiValid.h:40
MonitorElement * ResWzer0
Definition: RPCDigiValid.h:43
std::string outputFile_
Definition: RPCDigiValid.h:67
MonitorElement * ResDmin3
Definition: RPCDigiValid.h:52
MonitorElement * ResWmin1
Definition: RPCDigiValid.h:42
MonitorElement * ResDplu3
Definition: RPCDigiValid.h:55
MonitorElement * ResDmin1
Definition: RPCDigiValid.h:50
MonitorElement * ResWplu1
Definition: RPCDigiValid.h:44
MonitorElement * ResWmin2
Definition: RPCDigiValid.h:41
MonitorElement * ResDplu2
Definition: RPCDigiValid.h:54
MonitorElement * ResDmin2
Definition: RPCDigiValid.h:51
MonitorElement * BxDist
Definition: RPCDigiValid.h:46
std::string digiLabel
Definition: RPCDigiValid.h:68
MonitorElement * xyvDplu1
Definition: RPCDigiValid.h:58
MonitorElement * xyview
Definition: RPCDigiValid.h:38
MonitorElement * xyvDmin1
Definition: RPCDigiValid.h:62
MonitorElement * ResDplu1
Definition: RPCDigiValid.h:53
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:642
void setCurrentFolder(const std::string &fullpath)
Definition: DQMStore.cc:232
MonitorElement * rzview
Definition: RPCDigiValid.h:39
MonitorElement * xyvDmin3
Definition: RPCDigiValid.h:64
MonitorElement * xyvDplu2
Definition: RPCDigiValid.h:59
RPCDigiValid::~RPCDigiValid ( )

Definition at line 58 of file RPCDigiValid.cc.

58 {}

Member Function Documentation

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

Implements edm::EDAnalyzer.

Definition at line 66 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, ResDmin1, ResDmin2, ResDmin3, ResDplu1, ResDplu2, ResDplu3, ResWmin1, ResWmin2, ResWplu1, ResWplu2, ResWzer0, RPCDetId::ring(), RPCDetId, rzview, RPCDetId::station(), StripProf, GeomDet::toGlobal(), x, PV3DBase< T, PVType, FrameType >::x(), xyvDmin1, xyvDmin2, xyvDmin3, xyvDplu1, xyvDplu2, xyvDplu3, xyview, PV3DBase< T, PVType, FrameType >::y(), and PV3DBase< T, PVType, FrameType >::z().

66  {
67 
68  // cout << endl <<"--- [RPCDigiQuality] Analysing Event: #Run: " << event.id().run()
69  // << " #Event: " << event.id().event() << endl;
70 
71  // Get the RPC Geometry
73  eventSetup.get<MuonGeometryRecord>().get(rpcGeom);
74 
76  event.getByLabel("g4SimHits", "MuonRPCHits", simHit);
77 
79  event.getByLabel(digiLabel, rpcDigis);
80 
81  // Loop on simhits
82  PSimHitContainer::const_iterator simIt;
83 
84  //loop over Simhit
85  std::map<RPCDetId, std::vector<double> > allsims;
86 
87  for (simIt = simHit->begin(); simIt != simHit->end(); simIt++) {
88  RPCDetId Rsid = (RPCDetId)(*simIt).detUnitId();
89  const RPCRoll* soll = dynamic_cast<const RPCRoll* >( rpcGeom->roll(Rsid));
90  int ptype = simIt->particleType();
91 
92  // std::cout <<"This is a Simhit with Parent "<<ptype<<std::endl;
93  if (ptype == 13 || ptype == -13) {
94  std::vector<double> buff;
95  if (allsims.find(Rsid) != allsims.end() ){
96  buff= allsims[Rsid];
97  }
98  buff.push_back(simIt->localPosition().x());
99  allsims[Rsid]=buff;
100  }
101  GlobalPoint p=soll->toGlobal(simIt->localPosition());
102  /*
103  std::cout <<"Muon Position phi="<<p.phi()
104  <<" R="<<p.perp()
105  <<" z="<<p.z()<<std::endl;
106  */
107 
108  double sim_x = p.x();
109  double sim_y = p.y();
110 
111  xyview->Fill(sim_x, sim_y);
112 
113  if (Rsid.region() == 0 ){
114  }
115  else if (Rsid.region() == (+1)){
116  if (Rsid.station() == 1)
117  xyvDplu1->Fill(sim_x, sim_y);
118  else if (Rsid.station() == 2)
119  xyvDplu2->Fill(sim_x, sim_y);
120  else if (Rsid.station() == 3)
121  xyvDplu3->Fill(sim_x, sim_y);
122  }
123  else if (Rsid.region() == (-1)){
124  if (Rsid.station() == 1)
125  xyvDmin1->Fill(sim_x, sim_y);
126  else if (Rsid.station() == 2)
127  xyvDmin2->Fill(sim_x, sim_y);
128  else if (Rsid.station() == 3)
129  xyvDmin3->Fill(sim_x, sim_y);
130  }
131 
132 
133 // xyview->Fill(p.x(),p.y());
134  rzview->Fill(p.z(),p.perp());
135 
136  }
137  //loop over Digis
139  for (detUnitIt=rpcDigis->begin(); detUnitIt!=rpcDigis->end();++detUnitIt){
140  const RPCDetId Rsid = (*detUnitIt).first;
141  const RPCRoll* roll = dynamic_cast<const RPCRoll* >( rpcGeom->roll(Rsid));
142  const RPCDigiCollection::Range& range = (*detUnitIt).second;
143  std::vector<double> sims;
144  if (allsims.find(Rsid) != allsims.end() ){
145  sims = allsims[Rsid];
146  }
147  int ndigi=0;
148  for (RPCDigiCollection::const_iterator digiIt = range.first;
149  digiIt != range.second; ++digiIt){
150  StripProf->Fill(digiIt->strip());
151  BxDist->Fill(digiIt->bx());
152  ndigi++;
153  }
154 
155 
156  // std::cout<<" Number of Digi "<<ndigi<<" for "<<Rsid<<std::endl;
157 
158  if (sims.size() == 1 && ndigi == 1){
159  double dis = roll->centreOfStrip(range.first->strip()).x()-sims[0];
160  Res->Fill(dis);
161 
162  if (Rsid.region() == 0 ){
163  if (Rsid.ring() == -2)
164  ResWmin2->Fill(dis);
165  else if (Rsid.ring() == -1)
166  ResWmin1->Fill(dis);
167  else if (Rsid.ring() == 0)
168  ResWzer0->Fill(dis);
169  else if (Rsid.ring() == 1)
170  ResWplu1->Fill(dis);
171  else if (Rsid.ring() == 2)
172  ResWplu2->Fill(dis);
173  }
174  else if (Rsid.region() == (+1)){
175  if (Rsid.station() == 1)
176  ResDplu1->Fill(dis);
177  else if (Rsid.station() == 2)
178  ResDplu2->Fill(dis);
179  else if (Rsid.station() == 3)
180  ResDplu3->Fill(dis);
181  }
182  else if (Rsid.region() == (-1)){
183  if (Rsid.station() == 1)
184  ResDmin1->Fill(dis);
185  else if (Rsid.station() == 2)
186  ResDmin2->Fill(dis);
187  else if (Rsid.station() == 3)
188  ResDmin3->Fill(dis);
189  }
190  }
191  }
192 }
LocalPoint centreOfStrip(int strip) const
Definition: RPCRoll.cc:52
MonitorElement * xyvDmin2
Definition: RPCDigiValid.h:63
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 * xyvDplu3
Definition: RPCDigiValid.h:60
MonitorElement * StripProf
Definition: RPCDigiValid.h:47
MonitorElement * Res
Definition: RPCDigiValid.h:40
MonitorElement * ResWzer0
Definition: RPCDigiValid.h:43
void Fill(long long x)
MonitorElement * ResDmin3
Definition: RPCDigiValid.h:52
MonitorElement * ResWmin1
Definition: RPCDigiValid.h:42
MonitorElement * ResDplu3
Definition: RPCDigiValid.h:55
int ring() const
Definition: RPCDetId.h:74
MonitorElement * ResDmin1
Definition: RPCDigiValid.h:50
MonitorElement * ResWplu1
Definition: RPCDigiValid.h:44
T z() const
Definition: PV3DBase.h:58
MonitorElement * ResWmin2
Definition: RPCDigiValid.h:41
MonitorElement * ResDplu2
Definition: RPCDigiValid.h:54
MonitorElement * ResDmin2
Definition: RPCDigiValid.h:51
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:68
MonitorElement * xyvDplu1
Definition: RPCDigiValid.h:58
MonitorElement * xyview
Definition: RPCDigiValid.h:38
MonitorElement * xyvDmin1
Definition: RPCDigiValid.h:62
MonitorElement * ResDplu1
Definition: RPCDigiValid.h:53
Definition: DDAxes.h:10
T x() const
Definition: PV3DBase.h:56
MonitorElement * rzview
Definition: RPCDigiValid.h:39
MonitorElement * xyvDmin3
Definition: RPCDigiValid.h:64
MonitorElement * xyvDplu2
Definition: RPCDigiValid.h:59
int region() const
Region id: 0 for Barrel, +/-1 For +/- Endcap.
Definition: RPCDetId.h:65
int station() const
Definition: RPCDetId.h:98
void RPCDigiValid::beginJob ( void  )
protectedvirtual

Reimplemented from edm::EDAnalyzer.

Definition at line 60 of file RPCDigiValid.cc.

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

Reimplemented from edm::EDAnalyzer.

Definition at line 62 of file RPCDigiValid.cc.

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

62  {
63  if ( outputFile_.size() != 0 && dbe_ ) dbe_->save(outputFile_);
64 }
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:1898
DQMStore * dbe_
Definition: RPCDigiValid.h:66
std::string outputFile_
Definition: RPCDigiValid.h:67

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 66 of file RPCDigiValid.h.

Referenced by endJob(), and RPCDigiValid().

std::string RPCDigiValid::digiLabel
private

Definition at line 68 of file RPCDigiValid.h.

Referenced by analyze(), and RPCDigiValid().

std::string RPCDigiValid::outputFile_
private

Definition at line 67 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::ResDmin1
private

Definition at line 50 of file RPCDigiValid.h.

Referenced by analyze(), and RPCDigiValid().

MonitorElement* RPCDigiValid::ResDmin2
private

Definition at line 51 of file RPCDigiValid.h.

Referenced by analyze(), and RPCDigiValid().

MonitorElement* RPCDigiValid::ResDmin3
private

Definition at line 52 of file RPCDigiValid.h.

Referenced by analyze(), and RPCDigiValid().

MonitorElement* RPCDigiValid::ResDplu1
private

Definition at line 53 of file RPCDigiValid.h.

Referenced by analyze(), and RPCDigiValid().

MonitorElement* RPCDigiValid::ResDplu2
private

Definition at line 54 of file RPCDigiValid.h.

Referenced by analyze(), and RPCDigiValid().

MonitorElement* RPCDigiValid::ResDplu3
private

Definition at line 55 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::xyvDmin1
private

Definition at line 62 of file RPCDigiValid.h.

Referenced by analyze(), and RPCDigiValid().

MonitorElement* RPCDigiValid::xyvDmin2
private

Definition at line 63 of file RPCDigiValid.h.

Referenced by analyze(), and RPCDigiValid().

MonitorElement* RPCDigiValid::xyvDmin3
private

Definition at line 64 of file RPCDigiValid.h.

Referenced by analyze(), and RPCDigiValid().

MonitorElement* RPCDigiValid::xyvDplu1
private

Definition at line 58 of file RPCDigiValid.h.

Referenced by analyze(), and RPCDigiValid().

MonitorElement* RPCDigiValid::xyvDplu2
private

Definition at line 59 of file RPCDigiValid.h.

Referenced by analyze(), and RPCDigiValid().

MonitorElement* RPCDigiValid::xyvDplu3
private

Definition at line 60 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().