CMS 3D CMS Logo

List of all members | Public Member Functions | Private Types | Private Attributes
ME0SegmentsValidation Class Reference

#include <ME0SegmentsValidation.h>

Inheritance diagram for ME0SegmentsValidation:
ME0BaseValidation DQMEDAnalyzer edm::stream::EDAnalyzer< edm::RunSummaryCache< dqmDetails::NoCache >, edm::LuminosityBlockSummaryCache< dqmDetails::NoCache > > edm::stream::EDAnalyzerBase edm::EDConsumerBase

Public Member Functions

void analyze (const edm::Event &e, const edm::EventSetup &) override
 
void bookHistograms (DQMStore::IBooker &, edm::Run const &, edm::EventSetup const &) override
 
std::pair< int, int > isMatched (ME0DetId, LocalPoint, edm::Handle< ME0DigiPreRecoCollection >)
 
bool isSimMatched (edm::SimTrackContainer::const_iterator, edm::PSimHitContainer::const_iterator)
 
bool isSimTrackGood (edm::SimTrackContainer::const_iterator simTrack)
 
 ME0SegmentsValidation (const edm::ParameterSet &)
 
 ~ME0SegmentsValidation () override
 
- Public Member Functions inherited from ME0BaseValidation
MonitorElementBookHistXY (DQMStore::IBooker &, const char *name, const char *label, unsigned int region_num, unsigned int layer_num=99)
 
MonitorElementBookHistZR (DQMStore::IBooker &, const char *name, const char *label, unsigned int region_num, unsigned int layer_num=99)
 
 ME0BaseValidation (const edm::ParameterSet &ps)
 
 ~ME0BaseValidation () override
 
- Public Member Functions inherited from DQMEDAnalyzer
void beginRun (edm::Run const &, edm::EventSetup const &) final
 
void beginStream (edm::StreamID id) final
 
virtual void dqmBeginRun (edm::Run const &, edm::EventSetup const &)
 
 DQMEDAnalyzer ()
 
void endLuminosityBlockSummary (edm::LuminosityBlock const &, edm::EventSetup const &, dqmDetails::NoCache *) const final
 
void endRunSummary (edm::Run const &, edm::EventSetup const &, dqmDetails::NoCache *) const final
 
uint32_t streamId () const
 
- Public Member Functions inherited from edm::stream::EDAnalyzer< edm::RunSummaryCache< dqmDetails::NoCache >, edm::LuminosityBlockSummaryCache< dqmDetails::NoCache > >
 EDAnalyzer ()=default
 
- Public Member Functions inherited from edm::stream::EDAnalyzerBase
void callWhenNewProductsRegistered (std::function< void(BranchDescription const &)> const &func)
 
 EDAnalyzerBase ()
 
ModuleDescription const & moduleDescription () const
 
 ~EDAnalyzerBase () override
 
- Public Member Functions inherited from edm::EDConsumerBase
std::vector< ConsumesInfoconsumesInfo () const
 
void convertCurrentProcessAlias (std::string const &processName)
 Convert "@currentProcess" in InputTag process names to the actual current process name. More...
 
 EDConsumerBase ()
 
 EDConsumerBase (EDConsumerBase const &)=delete
 
 EDConsumerBase (EDConsumerBase &&)=default
 
ProductResolverIndexAndSkipBit indexFrom (EDGetToken, BranchType, TypeID const &) const
 
void itemsMayGet (BranchType, std::vector< ProductResolverIndexAndSkipBit > &) const
 
void itemsToGet (BranchType, std::vector< ProductResolverIndexAndSkipBit > &) const
 
std::vector< ProductResolverIndexAndSkipBit > const & itemsToGetFrom (BranchType iType) const
 
void labelsForToken (EDGetToken iToken, Labels &oLabels) const
 
void modulesWhoseProductsAreConsumed (std::vector< ModuleDescription const * > &modules, ProductRegistry const &preg, std::map< std::string, ModuleDescription const * > const &labelsToDesc, std::string const &processName) const
 
EDConsumerBase const & operator= (EDConsumerBase const &)=delete
 
EDConsumerBaseoperator= (EDConsumerBase &&)=default
 
bool registeredToConsume (ProductResolverIndex, bool, BranchType) const
 
bool registeredToConsumeMany (TypeID const &, BranchType) const
 
ProductResolverIndexAndSkipBit uncheckedIndexFrom (EDGetToken) const
 
void updateLookup (BranchType iBranchType, ProductResolverIndexHelper const &, bool iPrefetchMayGet)
 
virtual ~EDConsumerBase () noexcept(false)
 

Private Types

typedef std::map< ME0SegmentCollection::const_iterator, std::vector< ME0RecHit > > MapTypeSeg
 
typedef std::map< edm::SimTrackContainer::const_iterator, edm::PSimHitContainerMapTypeSim
 

Private Attributes

double eta_max_
 
double eta_min_
 
edm::EDGetToken InputTagToken_
 
edm::EDGetToken InputTagToken_Digis
 
edm::EDGetToken InputTagToken_Segments
 
edm::EDGetToken InputTagTokenST_
 
bool isMuonGun_
 
MonitorElementme0_matchedsimsegment_eta
 
MonitorElementme0_matchedsimsegment_phi
 
MonitorElementme0_matchedsimsegment_pt
 
MonitorElementme0_rh_xy_Muon [2][6]
 
MonitorElementme0_segment_chi2
 
MonitorElementme0_segment_EtaRH
 
MonitorElementme0_segment_ndof
 
MonitorElementme0_segment_numRH
 
MonitorElementme0_segment_numRHBkg
 
MonitorElementme0_segment_numRHSig
 
MonitorElementme0_segment_PhiRH
 
MonitorElementme0_segment_redchi2
 
MonitorElementme0_segment_size
 
MonitorElementme0_segment_time
 
MonitorElementme0_segment_timeErr
 
MonitorElementme0_simsegment_eta
 
MonitorElementme0_simsegment_phi
 
MonitorElementme0_simsegment_pt
 
MonitorElementme0_specRH_DeltaX [2][6]
 
MonitorElementme0_specRH_DeltaY [2][6]
 
MonitorElementme0_specRH_PullX [2][6]
 
MonitorElementme0_specRH_PullY [2][6]
 
MonitorElementme0_specRH_xy [2][6]
 
MonitorElementme0_specRH_zr [2]
 
int npart
 
double pt_min_
 
double sigma_x_
 
double sigma_y_
 

Additional Inherited Members

- Public Types inherited from edm::stream::EDAnalyzer< edm::RunSummaryCache< dqmDetails::NoCache >, edm::LuminosityBlockSummaryCache< dqmDetails::NoCache > >
typedef CacheContexts< T... > CacheTypes
 
typedef CacheTypes::GlobalCache GlobalCache
 
typedef AbilityChecker< T... > HasAbility
 
typedef CacheTypes::LuminosityBlockCache LuminosityBlockCache
 
typedef LuminosityBlockContextT< LuminosityBlockCache, RunCache, GlobalCacheLuminosityBlockContext
 
typedef CacheTypes::LuminosityBlockSummaryCache LuminosityBlockSummaryCache
 
typedef CacheTypes::RunCache RunCache
 
typedef RunContextT< RunCache, GlobalCacheRunContext
 
typedef CacheTypes::RunSummaryCache RunSummaryCache
 
- Public Types inherited from edm::stream::EDAnalyzerBase
typedef EDAnalyzerAdaptorBase ModuleType
 
- Public Types inherited from edm::EDConsumerBase
typedef ProductLabels Labels
 
- Static Public Member Functions inherited from DQMEDAnalyzer
static std::shared_ptr< dqmDetails::NoCacheglobalBeginLuminosityBlockSummary (edm::LuminosityBlock const &, edm::EventSetup const &, LuminosityBlockContext const *)
 
static std::shared_ptr< dqmDetails::NoCacheglobalBeginRunSummary (edm::Run const &, edm::EventSetup const &, RunContext const *)
 
static void globalEndLuminosityBlockSummary (edm::LuminosityBlock const &, edm::EventSetup const &, LuminosityBlockContext const *, dqmDetails::NoCache *)
 
static void globalEndRunSummary (edm::Run const &, edm::EventSetup const &, RunContext const *, dqmDetails::NoCache *)
 
- Static Public Member Functions inherited from edm::stream::EDAnalyzerBase
static const std::string & baseType ()
 
static void fillDescriptions (ConfigurationDescriptions &descriptions)
 
static void prevalidate (ConfigurationDescriptions &descriptions)
 
- Protected Member Functions inherited from edm::EDConsumerBase
template<typename ProductType , BranchType B = InEvent>
EDGetTokenT< ProductType > consumes (edm::InputTag const &tag)
 
EDGetToken consumes (const TypeToGet &id, edm::InputTag const &tag)
 
template<BranchType B>
EDGetToken consumes (TypeToGet const &id, edm::InputTag const &tag)
 
ConsumesCollector consumesCollector ()
 Use a ConsumesCollector to gather consumes information from helper functions. More...
 
template<typename ProductType , BranchType B = InEvent>
void consumesMany ()
 
void consumesMany (const TypeToGet &id)
 
template<BranchType B>
void consumesMany (const TypeToGet &id)
 
template<typename ProductType , BranchType B = InEvent>
EDGetTokenT< ProductType > mayConsume (edm::InputTag const &tag)
 
EDGetToken mayConsume (const TypeToGet &id, edm::InputTag const &tag)
 
template<BranchType B>
EDGetToken mayConsume (const TypeToGet &id, edm::InputTag const &tag)
 
- Protected Attributes inherited from ME0BaseValidation
edm::EDGetToken InputTagToken_
 
std::vector< std::string > layerLabel
 
int nBinXY_
 
std::vector< double > nBinZR_
 
std::vector< double > RangeZR_
 
std::vector< std::string > regionLabel
 

Detailed Description

Definition at line 17 of file ME0SegmentsValidation.h.

Member Typedef Documentation

Definition at line 58 of file ME0SegmentsValidation.h.

typedef std::map<edm::SimTrackContainer::const_iterator,edm::PSimHitContainer> ME0SegmentsValidation::MapTypeSim
private

Definition at line 57 of file ME0SegmentsValidation.h.

Constructor & Destructor Documentation

ME0SegmentsValidation::ME0SegmentsValidation ( const edm::ParameterSet cfg)
explicit

Definition at line 5 of file ME0SegmentsValidation.cc.

References eta_max_, eta_min_, edm::ParameterSet::getParameter(), InputTagToken_, InputTagToken_Digis, InputTagToken_Segments, InputTagTokenST_, isMuonGun_, pt_min_, sigma_x_, and sigma_y_.

5  : ME0BaseValidation(cfg)
6 {
7  InputTagToken_Segments = consumes<ME0SegmentCollection>(cfg.getParameter<edm::InputTag>("segmentInputLabel"));
8  InputTagToken_Digis = consumes<ME0DigiPreRecoCollection>(cfg.getParameter<edm::InputTag>("digiInputLabel"));
9  InputTagToken_ = consumes<edm::PSimHitContainer>(cfg.getParameter<edm::InputTag>("simInputLabel"));
10  InputTagTokenST_ = consumes<edm::SimTrackContainer>(cfg.getParameter<edm::InputTag>("simInputLabelST"));
11  sigma_x_ = cfg.getParameter<double>("sigma_x");
12  sigma_y_ = cfg.getParameter<double>("sigma_y");
13  eta_max_ = cfg.getParameter<double>("eta_max");
14  eta_min_ = cfg.getParameter<double>("eta_min");
15  pt_min_ = cfg.getParameter<double>("pt_min");
16  isMuonGun_ = cfg.getParameter<bool>("isMuonGun");
17 }
T getParameter(std::string const &) const
ME0BaseValidation(const edm::ParameterSet &ps)
edm::EDGetToken InputTagToken_Segments
edm::EDGetToken InputTagTokenST_
edm::EDGetToken InputTagToken_
edm::EDGetToken InputTagToken_Digis
ME0SegmentsValidation::~ME0SegmentsValidation ( )
override

Definition at line 86 of file ME0SegmentsValidation.cc.

86  {
87 }

Member Function Documentation

void ME0SegmentsValidation::analyze ( const edm::Event e,
const edm::EventSetup iSetup 
)
overridevirtual

Implements ME0BaseValidation.

Definition at line 90 of file ME0SegmentsValidation.cc.

References funct::abs(), relativeConstraints::chamber, ME0Geometry::chamber(), vertices_cff::chi2, KineDebug3::count(), PV3DBase< T, PVType, FrameType >::eta(), ME0Geometry::etaPartition(), MonitorElement::Fill(), objects.autophobj::float, edm::EventSetup::get(), edm::Event::getByToken(), runTauDisplay::gp, triggerObjects_cff::id, ME0Geometry::idToDet(), InputTagToken_, InputTagToken_Digis, InputTagToken_Segments, InputTagTokenST_, createfilelist::int, isMatched(), isSimMatched(), isSimTrackGood(), edm::HandleBase::isValid(), me0_matchedsimsegment_eta, me0_matchedsimsegment_phi, me0_matchedsimsegment_pt, me0_segment_chi2, me0_segment_ndof, me0_segment_numRH, me0_segment_numRHBkg, me0_segment_numRHSig, me0_segment_redchi2, me0_segment_size, me0_segment_time, me0_segment_timeErr, me0_simsegment_eta, me0_simsegment_phi, me0_simsegment_pt, me0_specRH_DeltaX, me0_specRH_DeltaY, me0_specRH_PullX, me0_specRH_PullY, me0_specRH_xy, me0_specRH_zr, ndof, PV3DBase< T, PVType, FrameType >::phi(), jets_cff::quality, mps_fire::result, reco::return(), sigma_x_, sigma_y_, simTrackMatching_cfi::simTrack, tkConvValidator_cfi::simTracks, mathSSE::sqrt(), GeomDet::surface(), ntuplemaker::time, Surface::toGlobal(), x, and y.

92 {
94  iSetup.get<MuonGeometryRecord>().get(hGeom);
95  const ME0Geometry* ME0Geometry_ =( &*hGeom);
96 
98  e.getByToken(InputTagToken_, ME0Hits);
99 
101  e.getByToken(InputTagTokenST_,simTracks);
102 
104  e.getByToken(InputTagToken_Segments, ME0Segments);
105 
107  e.getByToken(InputTagToken_Digis, ME0Digis);
108 
109  if (!ME0Digis.isValid() ) {
110  edm::LogError("ME0SegmentsValidation") << "Cannot get ME0Digis by Token InputTagToken";
111  return ;
112  }
113 
114  if (!ME0Segments.isValid() ) {
115  edm::LogError("ME0SegmentsValidation") << "Cannot get ME0RecHits/ME0Segments by Token InputTagToken";
116  return ;
117  }
118 
119  if (!ME0Hits.isValid()) {
120  edm::LogError("ME0HitsValidation") << "Cannot get ME0Hits by Token simInputTagToken";
121  return ;
122  }
123 
124 
125  MapTypeSim myMap;
126  MapTypeSeg myMapSeg;
127 
128  int countST = 0;
129 
130  edm::SimTrackContainer::const_iterator simTrack;
131  for (simTrack = simTracks->begin(); simTrack != simTracks->end(); ++simTrack){
132 
133  edm::PSimHitContainer selectedME0Hits;
134 
135  if(!isSimTrackGood(simTrack)) continue;
136  int count = 0;
137 
138  for (edm::PSimHitContainer::const_iterator itHit = ME0Hits->begin(); itHit != ME0Hits->end(); ++itHit){
139 
140  int particleType_sh = itHit->particleType();
141  int evtId_sh = itHit->eventId().event();
142  int bx_sh = itHit->eventId().bunchCrossing();
143  int procType_sh = itHit->processType();
144  if(!(abs(particleType_sh) == 13 && evtId_sh == 0 && bx_sh == 0 && procType_sh == 0)) continue;
145 
146  if(isSimMatched(simTrack, itHit)){
147 
148  ++count;
149  selectedME0Hits.push_back(*itHit);;
150 
151  }
152 
153  }//End loop SHs
154 
155  if(selectedME0Hits.size() >= 3){
156 
157  myMap.insert(MapTypeSim::value_type(simTrack,selectedME0Hits));
158  me0_simsegment_eta->Fill(std::abs((*simTrack).momentum().eta()));
159  me0_simsegment_pt->Fill((*simTrack).momentum().pt());
160  me0_simsegment_phi->Fill((*simTrack).momentum().phi());
161  ++countST;
162 
163  }
164 
165  }
166 
167  me0_segment_size->Fill(ME0Segments->size());
168 
169  for (auto me0s = ME0Segments->begin(); me0s != ME0Segments->end(); me0s++) {
170 
171  // The ME0 Ensamble DetId refers to layer = 1
172  ME0DetId id = me0s->me0DetId();
173  auto chamber = ME0Geometry_->chamber(id);
174  auto segLP = me0s->localPosition();
175  auto segLD = me0s->localDirection();
176  auto me0rhs = me0s->specificRecHits();
177 
178  // float localX = segLP.x();
179  // float localY = segLP.y();
180  // float dirTheta = segLD.theta();
181  // float dirPhi = segLD.phi();
182  int numberRH = me0rhs.size();
183  float chi2 = (float) me0s->chi2();
184  float ndof = me0s->degreesOfFreedom();
185  double time = me0s->time();
186  double timeErr = me0s->timeErr();
187 
188  float reducedChi2 = chi2/ndof;
189 
190  me0_segment_chi2->Fill(chi2);
191  me0_segment_redchi2->Fill(reducedChi2);
192  me0_segment_ndof->Fill(ndof);
193  me0_segment_numRH->Fill(numberRH);
194 
195  me0_segment_time->Fill(time);
196  me0_segment_timeErr->Fill(timeErr);
197 
198  int numberRHSig = 0;
199  int numberRHBkg = 0;
200  std::vector<ME0RecHit> selectedME0RecHits;
201 
202  for (auto rh = me0rhs.begin(); rh!= me0rhs.end(); rh++)
203  {
204 
205  auto me0id = rh->me0Id();
206  auto rhr = ME0Geometry_->etaPartition(me0id);
207  auto rhLP = rh->localPosition();
208 
209  auto result = isMatched(me0id, rhLP, ME0Digis);
210  if(result.second == 1){
211 
212  ++numberRHSig;
213  selectedME0RecHits.push_back(*rh);
214 
215  }
216  else ++numberRHBkg;
217 
218  auto erhLEP = rh->localPositionError();
219  auto rhGP = rhr->toGlobal(rhLP);
220  auto rhLPSegm = chamber->toLocal(rhGP);
221  float xe = segLP.x()+segLD.x()*rhLPSegm.z()/segLD.z();
222  float ye = segLP.y()+segLD.y()*rhLPSegm.z()/segLD.z();
223  float ze = rhLPSegm.z();
224  LocalPoint extrPoint(xe,ye,ze); // in segment rest frame
225  auto extSegm = rhr->toLocal(chamber->toGlobal(extrPoint)); // in layer restframe
226 
227  int region = me0id.region();
228  int layer = me0id.layer();
229  // int chamber = me0id.chamber();
230 
231  float x = rhLP.x();
232  float xErr = erhLEP.xx();
233  float y = rhLP.y();
234  float yErr = erhLEP.yy();
235 
236  float globalR = rhGP.perp();
237  float globalX = rhGP.x();
238  float globalY = rhGP.y();
239  float globalZ = rhGP.z();
240 
241  float xExt = extSegm.x();
242  float yExt = extSegm.y();
243 
244  float pull_x = (x - xExt) / sqrt(xErr);
245  float pull_y = (y - yExt) / sqrt(yErr);
246 
247  int region_num=0 ;
248  if ( region ==-1 ) region_num = 0 ;
249  else if ( region==1) region_num = 1;
250  int layer_num = layer-1;
251 
252  me0_specRH_xy[region_num][layer_num]->Fill(globalX,globalY);
253  me0_specRH_zr[region_num]->Fill(globalZ,globalR);
254 
255  me0_specRH_DeltaX[region_num][layer_num]->Fill(x - xExt);
256  me0_specRH_DeltaY[region_num][layer_num]->Fill(y - yExt);
257  me0_specRH_PullX[region_num][layer_num]->Fill(pull_x);
258  me0_specRH_PullY[region_num][layer_num]->Fill(pull_y);
259 
260  }
261 
262  me0_segment_numRHSig->Fill(numberRHSig);
263  me0_segment_numRHBkg->Fill(numberRHBkg);
264  myMapSeg.insert(MapTypeSeg::value_type(me0s,selectedME0RecHits));
265 
266  }
267 
268  //------------------- SimToReco -------------------
269 
270  for(auto const& st : myMap) {//loop over the signal simTracks
271 
272  int num_sh = st.second.size();
273  bool isThereOneSegmentMatched = false;
274 
275  for(auto const& seg : myMapSeg) {//loop over the reconstructed me0 segments
276 
277  int num_sh_matched = 0;
278  if(seg.second.empty()) continue;
279 
280  for(auto const& sh : st.second) {//loop over the me0 simHits left by the signal simTracks
281 
282  for(auto const& rh : seg.second) {//loop over the tracking recHits already matched to signal digis
283 
284  auto me0id = rh.me0Id();
285  int region_rh = (int) me0id.region();
286  int layer_rh = (int) me0id.layer();
287  int chamber_rh = (int) me0id.chamber();
288  int roll_rh = (int) me0id.roll();
289 
290  const ME0DetId id(sh.detUnitId());
291  int region_sh = id.region();
292  int layer_sh = id.layer();
293  int chamber_sh = id.chamber();
294  int roll_sh = id.roll();
295 
296  if( !(region_sh == region_rh && chamber_sh == chamber_rh && layer_sh == layer_rh && roll_sh == roll_rh) ) continue;
297 
298  LocalPoint lp_sh = sh.localPosition();
299  LocalPoint lp_rh = rh.localPosition();
300 
301  GlobalPoint gp_sh = ME0Geometry_->idToDet(id)->surface().toGlobal(lp_sh);
302  GlobalPoint gp = ME0Geometry_->idToDet((rh).me0Id())->surface().toGlobal(lp_rh);
303  float dphi_glob = gp_sh.phi()-gp.phi();
304  float deta_glob = gp_sh.eta()-gp.eta();
305 
306  if(fabs(dphi_glob) < 3*sigma_x_ && fabs(deta_glob) < 3*sigma_y_) ++num_sh_matched;
307 
308  }//End loop over RHs
309 
310  }//End loop over SHs
311 
312  float quality = 0;
313  if(num_sh != 0) quality = num_sh_matched/(1.0*num_sh);
314  if(quality > 0) isThereOneSegmentMatched = true;
315 
316  }//End loop over segments
317 
318  //Fill hsitograms
319  if(isThereOneSegmentMatched){
320 
321  me0_matchedsimsegment_eta->Fill( std::abs((*(st.first)).momentum().eta()) );
322  me0_matchedsimsegment_pt->Fill( (*(st.first)).momentum().pt() );
323  me0_matchedsimsegment_phi->Fill( (*(st.first)).momentum().phi() );
324 
325  }
326 
327  }//End loop over STs
328 
329 }
GlobalPoint toGlobal(const Point2DBase< Scalar, LocalTag > lp) const
Definition: Surface.h:106
bool isSimTrackGood(edm::SimTrackContainer::const_iterator simTrack)
MonitorElement * me0_segment_redchi2
MonitorElement * me0_simsegment_pt
bool getByToken(EDGetToken token, Handle< PROD > &result) const
Definition: Event.h:519
Geom::Phi< T > phi() const
Definition: PV3DBase.h:69
edm::EDGetToken InputTagToken_Segments
const ME0EtaPartition * etaPartition(ME0DetId id) const
Return a etaPartition given its id.
Definition: ME0Geometry.cc:64
const Plane & surface() const
The nominal surface of the GeomDet.
Definition: GeomDet.h:42
MonitorElement * me0_specRH_xy[2][6]
void Fill(long long x)
MonitorElement * me0_segment_ndof
MonitorElement * me0_segment_numRH
MonitorElement * me0_specRH_DeltaX[2][6]
simTrack
per collection params
T sqrt(T t)
Definition: SSEVec.h:18
MonitorElement * me0_segment_time
const ME0Chamber * chamber(ME0DetId id) const
Return a chamber given its id.
Definition: ME0Geometry.cc:73
Abs< T >::type abs(const T &t)
Definition: Abs.h:22
MonitorElement * me0_specRH_PullX[2][6]
MonitorElement * me0_segment_numRHBkg
edm::EDGetToken InputTagTokenST_
bool isValid() const
Definition: HandleBase.h:74
MonitorElement * me0_matchedsimsegment_phi
std::map< ME0SegmentCollection::const_iterator, std::vector< ME0RecHit > > MapTypeSeg
edm::EDGetToken InputTagToken_
MonitorElement * me0_segment_timeErr
edm::EDGetToken InputTagToken_Digis
MonitorElement * me0_specRH_PullY[2][6]
MonitorElement * me0_matchedsimsegment_pt
const T & get() const
Definition: EventSetup.h:58
std::pair< int, int > isMatched(ME0DetId, LocalPoint, edm::Handle< ME0DigiPreRecoCollection >)
MonitorElement * me0_segment_size
const GeomDet * idToDet(DetId) const override
Definition: ME0Geometry.cc:42
return(e1-e2)*(e1-e2)+dp *dp
T eta() const
Definition: PV3DBase.h:76
MonitorElement * me0_segment_chi2
MonitorElement * me0_simsegment_eta
MonitorElement * me0_segment_numRHSig
std::map< edm::SimTrackContainer::const_iterator, edm::PSimHitContainer > MapTypeSim
MonitorElement * me0_specRH_DeltaY[2][6]
std::vector< PSimHit > PSimHitContainer
MonitorElement * me0_simsegment_phi
MonitorElement * me0_matchedsimsegment_eta
bool isSimMatched(edm::SimTrackContainer::const_iterator, edm::PSimHitContainer::const_iterator)
MonitorElement * me0_specRH_zr[2]
void ME0SegmentsValidation::bookHistograms ( DQMStore::IBooker ibooker,
edm::Run const &  Run,
edm::EventSetup const &  iSetup 
)
overridevirtual

Implements DQMEDAnalyzer.

Definition at line 19 of file ME0SegmentsValidation.cc.

References DQMStore::IBooker::book1D(), ME0BaseValidation::BookHistXY(), ME0BaseValidation::BookHistZR(), ME0BaseValidation::layerLabel, LogDebug, M_PI, me0_matchedsimsegment_eta, me0_matchedsimsegment_phi, me0_matchedsimsegment_pt, me0_segment_chi2, me0_segment_ndof, me0_segment_numRH, me0_segment_numRHBkg, me0_segment_numRHSig, me0_segment_redchi2, me0_segment_size, me0_segment_time, me0_segment_timeErr, me0_simsegment_eta, me0_simsegment_phi, me0_simsegment_pt, me0_specRH_DeltaX, me0_specRH_DeltaY, me0_specRH_PullX, me0_specRH_PullY, me0_specRH_xy, me0_specRH_zr, ME0BaseValidation::regionLabel, DQMStore::IBooker::setCurrentFolder(), and AlCaHLTBitMon_QueryRunRegistry::string.

19  {
20  //edm::ESHandle<ME0Geometry> hGeom;
21  //iSetup.get<MuonGeometryRecord>().get(hGeom);
22  //const ME0Geometry* ME0Geometry_ =( &*hGeom);
23 
24  LogDebug("MuonME0SegmentsValidation")<<"Info : Loading Geometry information\n";
25  ibooker.setCurrentFolder("MuonME0RecHitsV/ME0SegmentsTask");
26 
27  unsigned int nregion = 2;
28 
29  edm::LogInfo("MuonME0SegmentsValidation")<<"+++ Info : # of region : "<<nregion<<std::endl;
30 
31  LogDebug("MuonME0SegmentsValidation")<<"+++ Info : finish to get geometry information from ES.\n";
32 
33  me0_simsegment_eta = ibooker.book1D("me0_simsegment_eta","SimSegment Eta Distribution; #eta; entries",8,2.0,2.8);
34  me0_simsegment_pt = ibooker.book1D("me0_simsegment_pt","SimSegment pT Distribution; p_{T}; entries",20,0.0,100.0);
35  me0_simsegment_phi = ibooker.book1D("me0_simsegment_phi","SimSegments phi Distribution; #phi; entries",18,-M_PI,+M_PI);
36 
37  me0_matchedsimsegment_eta = ibooker.book1D("me0_matchedsimsegment_eta","Matched SimSegment Eta Distribution; #eta; entries",8,2.0,2.8);
38  me0_matchedsimsegment_pt = ibooker.book1D("me0_matchedsimsegment_pt","Matched SimSegment pT Distribution; p_{T}; entries",20,0.0,100.0);
39  me0_matchedsimsegment_phi = ibooker.book1D("me0_matchedsimsegment_phi","Matched SimSegments phi Distribution; #phi; entries",18,-M_PI,+M_PI);
40 
41  me0_segment_chi2 = ibooker.book1D("me0_seg_Chi2","#chi^{2}; #chi^{2}; # Segments",100,0,100);
42  me0_segment_redchi2 = ibooker.book1D("me0_seg_ReducedChi2","#chi^{2}/ndof; #chi^{2}/ndof; # Segments",100,0,5);
43  me0_segment_ndof = ibooker.book1D("me0_seg_ndof","ndof; ndof; #Segments",50,0,50);
44  me0_segment_numRH = ibooker.book1D("me0_seg_NumberRH","Number of fitted RecHits; # RecHits; entries",11,-0.5,10.5);
45  me0_segment_numRHSig = ibooker.book1D("me0_seg_NumberRHSig","Number of fitted Signal RecHits; # RecHits; entries",11,-0.5,10.5);
46  me0_segment_numRHBkg = ibooker.book1D("me0_seg_NumberRHBkg","Number of fitted BKG RecHits; # RecHits; entries",11,-0.5,10.5);
47  //me0_segment_EtaRH = ibooker.book1D("me0_specRH_globalEta","Fitted RecHits Eta Distribution; #eta; entries",200,-4.0,4.0);
48  //me0_segment_PhiRH = ibooker.book1D("me0_specRH_globalPhi","Fitted RecHits Phi Distribution; #eta; entries",18,-3.14,3.14);
49  me0_segment_time = ibooker.book1D("me0_seg_time","Segment Timing; ns; entries",300,-150,150);
50  me0_segment_timeErr = ibooker.book1D("me0_seg_timErr","Segment Timing Error; ns; entries",50,0,0.5);
51  me0_segment_size = ibooker.book1D("me0_seg_size","Segment Multiplicity; Number of ME0 segments; entries",200,0,200);
52 
53  for( unsigned int region_num = 0 ; region_num < nregion ; region_num++ ) {
54  me0_specRH_zr[region_num] = BookHistZR(ibooker,"me0_specRH_tot","Segment RecHits",region_num);
55  for( unsigned int layer_num = 0 ; layer_num < 6 ; layer_num++) {
56 
57  //me0_strip_dg_zr[region_num][layer_num] = BookHistZR(ibooker,"me0_strip_dg","SimHit",region_num,layer_num);
58  me0_specRH_xy[region_num][layer_num] = BookHistXY(ibooker,"me0_specRH","Segment RecHits",region_num,layer_num);
59  //me0_rh_xy_Muon[region_num][layer_num] = BookHistXY(ibooker,"me0_rh","RecHit Muon",region_num,layer_num);
60 
61  std::string histo_name_DeltaX = std::string("me0_specRH_DeltaX_r")+regionLabel[region_num]+"_l"+layerLabel[layer_num];
62  std::string histo_name_DeltaY = std::string("me0_specRH_DeltaY_r")+regionLabel[region_num]+"_l"+layerLabel[layer_num];
63  std::string histo_label_DeltaX = "Segment RecHits Delta X : region"+regionLabel[region_num]+
64  " layer "+layerLabel[layer_num]+" "+" ; x_{SimHit} - x_{Segment RecHits} ; entries";
65  std::string histo_label_DeltaY = "Segment RecHits Delta Y : region"+regionLabel[region_num]+
66  " layer "+layerLabel[layer_num]+" "+" ; y_{SimHit} - y_{Segment RecHit} ; entries";
67 
68  me0_specRH_DeltaX[region_num][layer_num] = ibooker.book1D(histo_name_DeltaX.c_str(), histo_label_DeltaX.c_str(),100,-10,10);
69  me0_specRH_DeltaY[region_num][layer_num] = ibooker.book1D(histo_name_DeltaY.c_str(), histo_label_DeltaY.c_str(),100,-10,10);
70 
71  std::string histo_name_PullX = std::string("me0_specRH_PullX_r")+regionLabel[region_num]+"_l"+layerLabel[layer_num];
72  std::string histo_name_PullY = std::string("me0_specRH_PullY_r")+regionLabel[region_num]+"_l"+layerLabel[layer_num];
73  std::string histo_label_PullX = "Segment RecHits Pull X : region"+regionLabel[region_num]+
74  " layer "+layerLabel[layer_num]+" "+" ; #frac{x_{SimHit} - x_{Segment RecHit}}{#sigma_{x,RecHit}} ; entries";
75  std::string histo_label_PullY = "Segment RecHits Pull Y : region"+regionLabel[region_num]+
76  " layer "+layerLabel[layer_num]+" "+" ; #frac{y_{SimHit} - y_{Segment RecHit}}{#sigma_{y,RecHit}} ; entries";
77 
78  me0_specRH_PullX[region_num][layer_num] = ibooker.book1D(histo_name_PullX.c_str(), histo_label_DeltaX.c_str(),100,-10,10);
79  me0_specRH_PullY[region_num][layer_num] = ibooker.book1D(histo_name_PullY.c_str(), histo_label_DeltaY.c_str(),100,-10,10);
80 
81  }
82  }
83 }
#define LogDebug(id)
MonitorElement * BookHistZR(DQMStore::IBooker &, const char *name, const char *label, unsigned int region_num, unsigned int layer_num=99)
MonitorElement * me0_segment_redchi2
MonitorElement * me0_simsegment_pt
std::vector< std::string > layerLabel
MonitorElement * me0_specRH_xy[2][6]
MonitorElement * me0_segment_ndof
MonitorElement * BookHistXY(DQMStore::IBooker &, const char *name, const char *label, unsigned int region_num, unsigned int layer_num=99)
MonitorElement * me0_segment_numRH
MonitorElement * me0_specRH_DeltaX[2][6]
MonitorElement * book1D(Args &&...args)
Definition: DQMStore.h:118
MonitorElement * me0_segment_time
MonitorElement * me0_specRH_PullX[2][6]
MonitorElement * me0_segment_numRHBkg
std::vector< std::string > regionLabel
MonitorElement * me0_matchedsimsegment_phi
MonitorElement * me0_segment_timeErr
#define M_PI
MonitorElement * me0_specRH_PullY[2][6]
void setCurrentFolder(const std::string &fullpath)
Definition: DQMStore.cc:279
MonitorElement * me0_matchedsimsegment_pt
MonitorElement * me0_segment_size
MonitorElement * me0_segment_chi2
MonitorElement * me0_simsegment_eta
MonitorElement * me0_segment_numRHSig
MonitorElement * me0_specRH_DeltaY[2][6]
MonitorElement * me0_simsegment_phi
MonitorElement * me0_matchedsimsegment_eta
MonitorElement * me0_specRH_zr[2]
std::pair< int, int > ME0SegmentsValidation::isMatched ( ME0DetId  me0id,
LocalPoint  rhLP,
edm::Handle< ME0DigiPreRecoCollection ME0Digis 
)

Definition at line 332 of file ME0SegmentsValidation.cc.

References ME0DetId::chamber(), relativeConstraints::chamber, createfilelist::int, ME0DetId::layer(), objects.autophobj::particleType, ME0DetId::region(), mps_fire::result, ME0DetId::roll(), PV3DBase< T, PVType, FrameType >::x(), and PV3DBase< T, PVType, FrameType >::y().

Referenced by analyze().

333 {
334  int region_rh = (int) me0id.region();
335  int layer_rh = (int) me0id.layer();
336  int roll_rh = (int) me0id.roll();
337  int chamber_rh = (int) me0id.chamber();
338 
339  float l_x_rh = rhLP.x();
340  float l_y_rh = rhLP.y();
341 
342  int particleType = 0;
343  int isPrompt = -1;
344 
345  for (ME0DigiPreRecoCollection::DigiRangeIterator cItr=ME0Digis->begin(); cItr!=ME0Digis->end(); cItr++) {
346 
347  ME0DetId id = (*cItr).first;
348 
349  int region_dg = (int) id.region();
350  int layer_dg = (int) id.layer();
351  int roll_dg = (int) id.roll();
352  int chamber_dg = (int) id.chamber();
353 
354  if(region_rh != region_dg) continue;
355  if(layer_rh != layer_dg) continue;
356  if(chamber_rh != chamber_dg) continue;
357  if(roll_rh != roll_dg) continue;
358 
360  for (digiItr = (*cItr ).second.first; digiItr != (*cItr ).second.second; ++digiItr)
361  {
362 
363  float l_x_dg = digiItr->x();
364  float l_y_dg = digiItr->y();
365 
366  if(l_x_rh != l_x_dg) continue;
367  if(l_y_rh != l_y_dg) continue;
368 
369  particleType = digiItr->pdgid();
370  isPrompt = digiItr->prompt();
371 
372  }
373 
374  }
375 
376  std::pair<int,int> result;
377  result = std::make_pair(particleType,isPrompt);
378 
379  return result;
380 
381 }
T y() const
Definition: PV3DBase.h:63
int chamber() const
Chamber id: it identifies a chamber in a ring it goes from 1 to 36.
Definition: ME0DetId.h:51
int region() const
Region id: 0 for Barrel Not in use, +/-1 For +/- Endcap.
Definition: ME0DetId.h:46
std::vector< ME0DigiPreReco >::const_iterator const_iterator
int roll() const
Definition: ME0DetId.h:62
int layer() const
Layer id: each chamber has six layers of chambers: layer 1 is the inner layer and layer 6 is the oute...
Definition: ME0DetId.h:56
T x() const
Definition: PV3DBase.h:62
bool ME0SegmentsValidation::isSimMatched ( edm::SimTrackContainer::const_iterator  simTrack,
edm::PSimHitContainer::const_iterator  itHit 
)

Definition at line 398 of file ME0SegmentsValidation.cc.

References mps_fire::result.

Referenced by analyze().

399 {
400 
401  bool result = false;
402  int trackId = simTrack->trackId();
403  int trackId_sim = itHit->trackId();
404  if(trackId == trackId_sim) result = true;
405  return result;
406 
407 }
simTrack
per collection params
bool ME0SegmentsValidation::isSimTrackGood ( edm::SimTrackContainer::const_iterator  simTrack)

Definition at line 384 of file ME0SegmentsValidation.cc.

References funct::abs(), PVValHelper::eta, eta_max_, isMuonGun_, and pt_min_.

Referenced by analyze().

385 {
386 
387  if ((*t).noVertex() && !isMuonGun_) return false;
388  if ((*t).noGenpart() && !isMuonGun_) return false;
389  if (std::abs((*t).type()) != 13) return false; // only interested in direct muon simtracks
390  if ((*t).momentum().pt() < pt_min_ ) return false;
391  const float eta(std::abs((*t).momentum().eta()));
392  if (eta < eta_min_ || eta > eta_max_ ) return false; // no GEMs could be in such eta
393  return true;
394 
395 }
Abs< T >::type abs(const T &t)
Definition: Abs.h:22

Member Data Documentation

double ME0SegmentsValidation::eta_max_
private

Definition at line 53 of file ME0SegmentsValidation.h.

Referenced by isSimTrackGood(), and ME0SegmentsValidation().

double ME0SegmentsValidation::eta_min_
private

Definition at line 53 of file ME0SegmentsValidation.h.

Referenced by ME0SegmentsValidation().

edm::EDGetToken ME0SegmentsValidation::InputTagToken_
private

Definition at line 48 of file ME0SegmentsValidation.h.

Referenced by analyze(), and ME0SegmentsValidation().

edm::EDGetToken ME0SegmentsValidation::InputTagToken_Digis
private

Definition at line 47 of file ME0SegmentsValidation.h.

Referenced by analyze(), and ME0SegmentsValidation().

edm::EDGetToken ME0SegmentsValidation::InputTagToken_Segments
private

Definition at line 46 of file ME0SegmentsValidation.h.

Referenced by analyze(), and ME0SegmentsValidation().

edm::EDGetToken ME0SegmentsValidation::InputTagTokenST_
private

Definition at line 49 of file ME0SegmentsValidation.h.

Referenced by analyze(), and ME0SegmentsValidation().

bool ME0SegmentsValidation::isMuonGun_
private

Definition at line 55 of file ME0SegmentsValidation.h.

Referenced by isSimTrackGood(), and ME0SegmentsValidation().

MonitorElement* ME0SegmentsValidation::me0_matchedsimsegment_eta
private

Definition at line 39 of file ME0SegmentsValidation.h.

Referenced by analyze(), and bookHistograms().

MonitorElement * ME0SegmentsValidation::me0_matchedsimsegment_phi
private

Definition at line 39 of file ME0SegmentsValidation.h.

Referenced by analyze(), and bookHistograms().

MonitorElement * ME0SegmentsValidation::me0_matchedsimsegment_pt
private

Definition at line 39 of file ME0SegmentsValidation.h.

Referenced by analyze(), and bookHistograms().

MonitorElement* ME0SegmentsValidation::me0_rh_xy_Muon[2][6]
private

Definition at line 30 of file ME0SegmentsValidation.h.

MonitorElement* ME0SegmentsValidation::me0_segment_chi2
private

Definition at line 33 of file ME0SegmentsValidation.h.

Referenced by analyze(), and bookHistograms().

MonitorElement* ME0SegmentsValidation::me0_segment_EtaRH
private

Definition at line 36 of file ME0SegmentsValidation.h.

MonitorElement * ME0SegmentsValidation::me0_segment_ndof
private

Definition at line 33 of file ME0SegmentsValidation.h.

Referenced by analyze(), and bookHistograms().

MonitorElement* ME0SegmentsValidation::me0_segment_numRH
private

Definition at line 35 of file ME0SegmentsValidation.h.

Referenced by analyze(), and bookHistograms().

MonitorElement * ME0SegmentsValidation::me0_segment_numRHBkg
private

Definition at line 35 of file ME0SegmentsValidation.h.

Referenced by analyze(), and bookHistograms().

MonitorElement * ME0SegmentsValidation::me0_segment_numRHSig
private

Definition at line 35 of file ME0SegmentsValidation.h.

Referenced by analyze(), and bookHistograms().

MonitorElement * ME0SegmentsValidation::me0_segment_PhiRH
private

Definition at line 36 of file ME0SegmentsValidation.h.

MonitorElement * ME0SegmentsValidation::me0_segment_redchi2
private

Definition at line 33 of file ME0SegmentsValidation.h.

Referenced by analyze(), and bookHistograms().

MonitorElement * ME0SegmentsValidation::me0_segment_size
private

Definition at line 36 of file ME0SegmentsValidation.h.

Referenced by analyze(), and bookHistograms().

MonitorElement* ME0SegmentsValidation::me0_segment_time
private

Definition at line 34 of file ME0SegmentsValidation.h.

Referenced by analyze(), and bookHistograms().

MonitorElement * ME0SegmentsValidation::me0_segment_timeErr
private

Definition at line 34 of file ME0SegmentsValidation.h.

Referenced by analyze(), and bookHistograms().

MonitorElement* ME0SegmentsValidation::me0_simsegment_eta
private

Definition at line 38 of file ME0SegmentsValidation.h.

Referenced by analyze(), and bookHistograms().

MonitorElement * ME0SegmentsValidation::me0_simsegment_phi
private

Definition at line 38 of file ME0SegmentsValidation.h.

Referenced by analyze(), and bookHistograms().

MonitorElement * ME0SegmentsValidation::me0_simsegment_pt
private

Definition at line 38 of file ME0SegmentsValidation.h.

Referenced by analyze(), and bookHistograms().

MonitorElement* ME0SegmentsValidation::me0_specRH_DeltaX[2][6]
private

Definition at line 41 of file ME0SegmentsValidation.h.

Referenced by analyze(), and bookHistograms().

MonitorElement* ME0SegmentsValidation::me0_specRH_DeltaY[2][6]
private

Definition at line 42 of file ME0SegmentsValidation.h.

Referenced by analyze(), and bookHistograms().

MonitorElement* ME0SegmentsValidation::me0_specRH_PullX[2][6]
private

Definition at line 43 of file ME0SegmentsValidation.h.

Referenced by analyze(), and bookHistograms().

MonitorElement* ME0SegmentsValidation::me0_specRH_PullY[2][6]
private

Definition at line 44 of file ME0SegmentsValidation.h.

Referenced by analyze(), and bookHistograms().

MonitorElement* ME0SegmentsValidation::me0_specRH_xy[2][6]
private

Definition at line 29 of file ME0SegmentsValidation.h.

Referenced by analyze(), and bookHistograms().

MonitorElement* ME0SegmentsValidation::me0_specRH_zr[2]
private

Definition at line 31 of file ME0SegmentsValidation.h.

Referenced by analyze(), and bookHistograms().

int ME0SegmentsValidation::npart
private

Definition at line 51 of file ME0SegmentsValidation.h.

double ME0SegmentsValidation::pt_min_
private

Definition at line 54 of file ME0SegmentsValidation.h.

Referenced by isSimTrackGood(), and ME0SegmentsValidation().

double ME0SegmentsValidation::sigma_x_
private

Definition at line 52 of file ME0SegmentsValidation.h.

Referenced by analyze(), and ME0SegmentsValidation().

double ME0SegmentsValidation::sigma_y_
private

Definition at line 52 of file ME0SegmentsValidation.h.

Referenced by analyze(), and ME0SegmentsValidation().