test
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 Attributes
SiPixelHitEfficiencySource Class Reference

#include <SiPixelHitEfficiencySource.h>

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

Public Member Functions

virtual void analyze (const edm::Event &, const edm::EventSetup &)
 
virtual void bookHistograms (DQMStore::IBooker &, edm::Run const &, edm::EventSetup const &) override
 
virtual void dqmBeginRun (const edm::Run &r, edm::EventSetup const &iSetup)
 
virtual void fillClusterProbability (int, int, bool, double)
 
 SiPixelHitEfficiencySource (const edm::ParameterSet &)
 
 ~SiPixelHitEfficiencySource ()
 
- Public Member Functions inherited from DQMEDAnalyzer
virtual void beginRun (edm::Run const &, edm::EventSetup const &) final
 
virtual void beginStream (edm::StreamID id) final
 
 DQMEDAnalyzer (void)
 
virtual void endLuminosityBlockSummary (edm::LuminosityBlock const &, edm::EventSetup const &, dqmDetails::NoCache *) const final
 
virtual 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
 
virtual ~EDAnalyzerBase ()
 
- Public Member Functions inherited from edm::EDConsumerBase
std::vector< ConsumesInfoconsumesInfo () const
 
 EDConsumerBase ()
 
ProductHolderIndexAndSkipBit indexFrom (EDGetToken, BranchType, TypeID const &) const
 
void itemsMayGet (BranchType, std::vector< ProductHolderIndexAndSkipBit > &) const
 
void itemsToGet (BranchType, std::vector< ProductHolderIndexAndSkipBit > &) const
 
std::vector
< ProductHolderIndexAndSkipBit >
const & 
itemsToGetFromEvent () const
 
void labelsForToken (EDGetToken iToken, Labels &oLabels) const
 
void modulesDependentUpon (const std::string &iProcessName, std::vector< const char * > &oModuleLabels) const
 
void modulesWhoseProductsAreConsumed (std::vector< ModuleDescription const * > &modules, ProductRegistry const &preg, std::map< std::string, ModuleDescription const * > const &labelsToDesc, std::string const &processName) const
 
bool registeredToConsume (ProductHolderIndex, bool, BranchType) const
 
bool registeredToConsumeMany (TypeID const &, BranchType) const
 
void updateLookup (BranchType iBranchType, ProductHolderIndexHelper const &)
 
virtual ~EDConsumerBase ()
 

Private Attributes

bool applyEdgeCut_
 
bool bladeOn
 
edm::EDGetTokenT
< edmNew::DetSetVector
< SiPixelCluster > > 
clusterCollectionToken_
 
bool debug_
 
bool diskOn
 
bool firstRun
 
bool isUpgrade
 
bool ladOn
 
bool layOn
 
edm::EDGetTokenT
< MeasurementTrackerEvent
measurementTrackerEventToken_
 
MonitorElementmeClusterProbabilityD1_Minus_
 
MonitorElementmeClusterProbabilityD1_Plus_
 
MonitorElementmeClusterProbabilityD2_Minus_
 
MonitorElementmeClusterProbabilityD2_Plus_
 
MonitorElementmeClusterProbabilityL1_Minus_
 
MonitorElementmeClusterProbabilityL1_Plus_
 
MonitorElementmeClusterProbabilityL2_Minus_
 
MonitorElementmeClusterProbabilityL2_Plus_
 
MonitorElementmeClusterProbabilityL3_Minus_
 
MonitorElementmeClusterProbabilityL3_Plus_
 
bool modOn
 
int nmissing
 
double nSigma_EdgeCut_
 
int nvalid
 
int nvtx_
 
bool phiOn
 
edm::ParameterSet pSet_
 
bool ringOn
 
edm::InputTag src_
 
std::map< uint32_t,
SiPixelHitEfficiencyModule * > 
theSiPixelStructure
 
edm::EDGetTokenT
< TrajTrackAssociationCollection
tracksrc_
 
edm::EDGetTokenT
< reco::VertexCollection
vertexCollectionToken_
 
double vtxchi2_
 
double vtxD0_
 
double vtxndof_
 
int vtxntrk_
 
double vtxX_
 
double vtxY_
 
double vtxZ_
 

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, GlobalCache
LuminosityBlockContext
 
typedef
CacheTypes::LuminosityBlockSummaryCache 
LuminosityBlockSummaryCache
 
typedef CacheTypes::RunCache RunCache
 
typedef RunContextT< RunCache,
GlobalCache
RunContext
 
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::NoCache
globalBeginLuminosityBlockSummary (edm::LuminosityBlock const &, edm::EventSetup const &, LuminosityBlockContext const *)
 
static std::shared_ptr
< dqmDetails::NoCache
globalBeginRunSummary (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)
 

Detailed Description

Definition at line 44 of file SiPixelHitEfficiencySource.h.

Constructor & Destructor Documentation

SiPixelHitEfficiencySource::SiPixelHitEfficiencySource ( const edm::ParameterSet pSet)
explicit

Definition at line 73 of file SiPixelHitEfficiencySource.cc.

References applyEdgeCut_, bladeOn, clusterCollectionToken_, debug_, diskOn, firstRun, edm::ParameterSet::getParameter(), edm::ParameterSet::getUntrackedParameter(), ladOn, layOn, measurementTrackerEventToken_, modOn, nSigma_EdgeCut_, phiOn, pSet_, ringOn, AlCaHLTBitMon_QueryRunRegistry::string, tracksrc_, and vertexCollectionToken_.

73  :
74  pSet_(pSet),
75  modOn( pSet.getUntrackedParameter<bool>("modOn",true) ),
76  ladOn( pSet.getUntrackedParameter<bool>("ladOn",false) ),
77  layOn( pSet.getUntrackedParameter<bool>("layOn",false) ),
78  phiOn( pSet.getUntrackedParameter<bool>("phiOn",false) ),
79  ringOn( pSet.getUntrackedParameter<bool>("ringOn",false) ),
80  bladeOn( pSet.getUntrackedParameter<bool>("bladeOn",false) ),
81  diskOn( pSet.getUntrackedParameter<bool>("diskOn",false) ),
82  isUpgrade( pSet.getUntrackedParameter<bool>("isUpgrade",false) )
83  //updateEfficiencies( pSet.getUntrackedParameter<bool>("updateEfficiencies",false) )
84 {
85  pSet_ = pSet;
86  debug_ = pSet_.getUntrackedParameter<bool>("debug", false);
87  applyEdgeCut_ = pSet_.getUntrackedParameter<bool>("applyEdgeCut");
88  nSigma_EdgeCut_ = pSet_.getUntrackedParameter<double>("nSigma_EdgeCut");
89  vertexCollectionToken_ = consumes<reco::VertexCollection>(std::string("offlinePrimaryVertices"));
90  tracksrc_ = consumes<TrajTrackAssociationCollection>(pSet_.getParameter<edm::InputTag>("trajectoryInput"));
91  clusterCollectionToken_ = consumes<edmNew::DetSetVector<SiPixelCluster> >(std::string("siPixelClusters"));
92 
93  measurementTrackerEventToken_ = consumes<MeasurementTrackerEvent>(std::string("MeasurementTrackerEvent"));
94 
95  firstRun = true;
96 
97  LogInfo("PixelDQM") << "SiPixelHitEfficiencySource constructor" << endl;
98  LogInfo ("PixelDQM") << "Mod/Lad/Lay/Phi " << modOn << "/" << ladOn << "/"
99  << layOn << "/" << phiOn << std::endl;
100  LogInfo ("PixelDQM") << "Blade/Disk/Ring" << bladeOn << "/" << diskOn << "/"
101  << ringOn << std::endl;
102 }
edm::EDGetTokenT< MeasurementTrackerEvent > measurementTrackerEventToken_
T getParameter(std::string const &) const
T getUntrackedParameter(std::string const &, T const &) const
edm::EDGetTokenT< edmNew::DetSetVector< SiPixelCluster > > clusterCollectionToken_
edm::EDGetTokenT< reco::VertexCollection > vertexCollectionToken_
edm::EDGetTokenT< TrajTrackAssociationCollection > tracksrc_
SiPixelHitEfficiencySource::~SiPixelHitEfficiencySource ( )

Definition at line 105 of file SiPixelHitEfficiencySource.cc.

References theSiPixelStructure.

105  {
106  LogInfo("PixelDQM") << "SiPixelHitEfficiencySource destructor" << endl;
107 
108  std::map<uint32_t,SiPixelHitEfficiencyModule*>::iterator struct_iter;
109  for (struct_iter = theSiPixelStructure.begin() ; struct_iter != theSiPixelStructure.end() ; struct_iter++){
110  delete struct_iter->second;
111  struct_iter->second = 0;
112  }
113 }
std::map< uint32_t, SiPixelHitEfficiencyModule * > theSiPixelStructure

Member Function Documentation

void SiPixelHitEfficiencySource::analyze ( const edm::Event iEvent,
const edm::EventSetup iSetup 
)
virtual

Implements edm::stream::EDAnalyzerBase.

Definition at line 260 of file SiPixelHitEfficiencySource.cc.

References funct::abs(), edm::AssociationMap< Tag >::begin(), edmNew::DetSetVector< T >::begin(), bladeOn, clusterCollectionToken_, SiPixelRecHit::clusterProbability(), edm::AssociationMap< edm::OneToOne< std::vector< Trajectory >, reco::TrackCollection, unsigned short > >::const_iterator, gather_cfg::cout, debug_, PixelEndcapName::diskName(), diskOn, edm::AssociationMap< Tag >::end(), edmNew::DetSetVector< T >::end(), HLT_25ns14e33_v1_cff::estimator, f, fillClusterProbability(), edm::EventSetup::get(), edm::Event::getByToken(), PixelClusterParameterEstimator::getParameters(), TrajectoryStateOnSurface::globalPosition(), PixelEndcapName::halfCylinder(), i, edmNew::DetSetVector< T >::id(), TrackerGeometry::idToDetUnit(), PixelBarrelName::isHalfModule(), isUpgrade, edm::ESHandleBase::isValid(), edm::HandleBase::isValid(), edm::Ref< C, T, F >::key(), PXBDetId::ladder(), ladOn, PixelBarrelName::layerName(), layOn, TrajectoryStateOnSurface::localParameters(), TrajectoryStateOnSurface::localPosition(), match(), LayerMeasurements::measurements(), measurementTrackerEventToken_, TrackingRecHit::missing, modOn, PXBDetId::module(), nmissing, nvalid, nvtx_, oppositeToMomentum, AlCaHLTBitMon_ParallelJobs::p, PixelEndcapName::pannelName(), phiOn, PixelSubdetector::PixelBarrel, PixelSubdetector::PixelEndcap, PixelEndcapName::plaquetteName(), reco::HaloData::plus, edm::Handle< T >::product(), edm::ESHandle< class >::product(), TrajectoryMeasurement::recHit(), ringOn, Propagator::setPropagationDirection(), PixelBarrelName::shell(), edm::AssociationMap< Tag >::size(), mathSSE::sqrt(), DetId::subdetId(), StripSubdetector::TEC, theSiPixelStructure, StripSubdetector::TIB, StripSubdetector::TID, StripSubdetector::TOB, DetId::Tracker, patCandidatesForDimuonsSequences_cff::tracker, tracksrc_, TrackingRecHit::valid, vertexCollectionToken_, HLT_25ns14e33_v1_cff::vertices, vtxchi2_, vtxD0_, vtxndof_, vtxntrk_, vtxX_, vtxY_, vtxZ_, x, PV3DBase< T, PVType, FrameType >::x(), y, PV3DBase< T, PVType, FrameType >::y(), z, and PV3DBase< T, PVType, FrameType >::z().

260  {
261 
262  edm::ESHandle<TrackerTopology> tTopoHandle;
263  iSetup.get<TrackerTopologyRcd>().get(tTopoHandle);
264  const TrackerTopology *pTT = tTopoHandle.product();
265 
266  edm::Handle<reco::VertexCollection> vertexCollectionHandle;
267  iEvent.getByToken( vertexCollectionToken_, vertexCollectionHandle );
268  if(!vertexCollectionHandle.isValid()) return;
269  nvtx_=0;
270  vtxntrk_=-9999;
271  vtxD0_=-9999.; vtxX_=-9999.; vtxY_=-9999.; vtxZ_=-9999.; vtxndof_=-9999.; vtxchi2_=-9999.;
272  const reco::VertexCollection & vertices = *vertexCollectionHandle.product();
273  reco::VertexCollection::const_iterator bestVtx=vertices.end();
274  for(reco::VertexCollection::const_iterator it=vertices.begin(); it!=vertices.end(); ++it){
275  if(!it->isValid()) continue;
276  if(vtxntrk_==-9999 ||
277  vtxntrk_<int(it->tracksSize()) ||
278  (vtxntrk_==int(it->tracksSize()) && fabs(vtxZ_)>fabs(it->z()))){
279  vtxntrk_=it->tracksSize();
280  vtxD0_=it->position().rho();
281  vtxX_=it->x();
282  vtxY_=it->y();
283  vtxZ_=it->z();
284  vtxndof_=it->ndof();
285  vtxchi2_=it->chi2();
286  bestVtx=it;
287  }
288  if(fabs(it->z())<=20. && fabs(it->position().rho())<=2. && it->ndof()>4) nvtx_++;
289  }
290  if(nvtx_<1) return;
291 
292  //get the map
294  iEvent.getByToken( tracksrc_, match );
295  const TrajTrackAssociationCollection ttac = *(match.product());
296 
297  if(debug_){
298  std::cout << "+++ NEW EVENT +++"<< std::endl;
299  std::cout << "Map entries \t : " << ttac.size() << std::endl;
300  }
301 
302  std::set<SiPixelCluster> clusterSet;
303  // TrajectoryStateCombiner tsoscomb;
304  //define variables for extrapolation
305  int extrapolateFrom_ = 2;
306  int extrapolateTo_ = 1;
307  float maxlxmatch_=0.2;
308  float maxlymatch_=0.2;
309  bool keepOriginalMissingHit_=true;
310  ESHandle<MeasurementTracker> measurementTrackerHandle;
311 
312  iSetup.get<CkfComponentsRecord>().get(measurementTrackerHandle);
313 
315  iSetup.get<TrackingComponentsRecord>().get("Chi2",est);
316  edm::Handle<MeasurementTrackerEvent> measurementTrackerEventHandle;
317  iEvent.getByToken(measurementTrackerEventToken_, measurementTrackerEventHandle);
319  iSetup.get<TrackingComponentsRecord>().get("PropagatorWithMaterial",prop);
320  Propagator* thePropagator = prop.product()->clone();
321  //determines direction of the propagator => inward
322  if (extrapolateFrom_>=extrapolateTo_) {
324  }
325  TrajectoryStateCombiner trajStateComb;
326  bool debug_ = false;
327 
328  //Loop over track collection
329  for(TrajTrackAssociationCollection::const_iterator it = ttac.begin();it != ttac.end(); ++it){
330  //define vector to save extrapolated tracks
331  std::vector<TrajectoryMeasurement> expTrajMeasurements;
332 
333  const edm::Ref<std::vector<Trajectory> > traj_iterator = it->key;
334  // Trajectory Map, extract Trajectory for this track
335  reco::TrackRef trackref = it->val;
336  //tracks++;
337 
338  bool isBpixtrack = false, isFpixtrack = false;
339  int nStripHits=0; int L1hits=0; int L2hits=0; int L3hits=0; int L4hits=0; int D1hits=0; int D2hits=0; int D3hits=0;
340  std::vector<TrajectoryMeasurement> tmeasColl =traj_iterator->measurements();
341  std::vector<TrajectoryMeasurement>::const_iterator tmeasIt;
342  //loop on measurements to find out what kind of hits there are
343  for(tmeasIt = tmeasColl.begin();tmeasIt!=tmeasColl.end();tmeasIt++){
344  //if(! tmeasIt->updatedState().isValid()) continue; NOT NECESSARY (I HOPE)
345  TransientTrackingRecHit::ConstRecHitPointer testhit = tmeasIt->recHit();
346  if(testhit->geographicalId().det() != DetId::Tracker) continue;
347  uint testSubDetID = (testhit->geographicalId().subdetId());
348  const DetId & hit_detId = testhit->geographicalId();
349  int hit_layer = 0;
350  int hit_ladder = 0;
351  int hit_mod = 0;
352  int hit_disk = 0;
353 
354  if(testSubDetID==PixelSubdetector::PixelBarrel){
355  isBpixtrack = true;
356  hit_layer = PixelBarrelName(hit_detId,pTT,isUpgrade).layerName();
357 
358  hit_ladder = PXBDetId(hit_detId).ladder();
359  hit_mod = PXBDetId(hit_detId).module();
360 
361  if(hit_layer==1) L1hits++;
362  if(hit_layer==2) L2hits++;
363  if(hit_layer==3) L3hits++;
364  if(hit_layer==4) L4hits++;
365  }
366  if(testSubDetID==PixelSubdetector::PixelEndcap){
367  isFpixtrack = true;
368  hit_disk = PixelEndcapName(hit_detId,pTT,isUpgrade).diskName();
369 
370  if(hit_disk==1) D1hits++;
371  if(hit_disk==2) D2hits++;
372  if(hit_disk==3) D3hits++;
373  }
374  if(testSubDetID==StripSubdetector::TIB) nStripHits++;
375  if(testSubDetID==StripSubdetector::TOB) nStripHits++;
376  if(testSubDetID==StripSubdetector::TID) nStripHits++;
377  if(testSubDetID==StripSubdetector::TEC) nStripHits++;
378  //check if last valid hit is in Layer 2 or Disk 1
379 
380  bool lastValidL2 = false;
381  if ((testSubDetID == PixelSubdetector::PixelBarrel && hit_layer == extrapolateFrom_)
382  || (testSubDetID == PixelSubdetector::PixelEndcap && hit_disk == 1)) {
383  if (testhit->isValid()) {
384  if (tmeasIt == tmeasColl.end()-1) {
385  lastValidL2=true;
386  } else {
387  tmeasIt++;
388  TransientTrackingRecHit::ConstRecHitPointer nextRecHit = tmeasIt->recHit();
389  uint nextSubDetID = (nextRecHit->geographicalId().subdetId());
390  int nextlayer = PixelBarrelName(nextRecHit->geographicalId()).layerName();
391  if (nextSubDetID == PixelSubdetector::PixelBarrel && nextlayer==extrapolateTo_ ) {
392  lastValidL2=true; //&& !nextRecHit->isValid()) lastValidL2=true;
393  }
394  tmeasIt--;
395  }
396  }
397  }//end check last valid layer
398  if (lastValidL2) {
399  std::vector< const BarrelDetLayer*> pxbLayers = measurementTrackerHandle->geometricSearchTracker()->pixelBarrelLayers();
400  const DetLayer* pxb1 = pxbLayers[extrapolateTo_-1];
401  const MeasurementEstimator* estimator = est.product();
402  const LayerMeasurements* theLayerMeasurements = new LayerMeasurements(*measurementTrackerHandle, *measurementTrackerEventHandle);
403  const TrajectoryStateOnSurface tsosPXB2 = tmeasIt->updatedState();
404  expTrajMeasurements = theLayerMeasurements->measurements(*pxb1, tsosPXB2, *thePropagator, *estimator);
405  delete theLayerMeasurements;
406  if ( !expTrajMeasurements.empty()) {
407  for(uint p=0; p<expTrajMeasurements.size();p++){
408  TrajectoryMeasurement pxb1TM(expTrajMeasurements[p]);
409  auto pxb1Hit = pxb1TM.recHit();
410  //remove hits with rawID == 0
411  if(pxb1Hit->geographicalId().rawId()==0){
412  expTrajMeasurements.erase(expTrajMeasurements.begin()+p);
413  continue;
414  }
415  }
416  }
417  //
418  }
419  //check if extrapolated hit to layer 1 one matches the original hit
420  TrajectoryStateOnSurface chkPredTrajState=trajStateComb(tmeasIt->forwardPredictedState(), tmeasIt->backwardPredictedState());
421  float chkx=chkPredTrajState.globalPosition().x();
422  float chky=chkPredTrajState.globalPosition().y();
423  float chkz=chkPredTrajState.globalPosition().z();
424  LocalPoint chklp=chkPredTrajState.localPosition();
425  if (testSubDetID == PixelSubdetector::PixelBarrel && hit_layer == extrapolateTo_) {
426  // Here we will drop the extrapolated hits if there is a hit and use that hit
427  vector<int > imatches;
428  size_t imatch=0;
429  float glmatch=9999.;
430  for (size_t iexp=0; iexp<expTrajMeasurements.size(); iexp++) {
431  const DetId & exphit_detId = expTrajMeasurements[iexp].recHit()->geographicalId();
432  int exphit_ladder = PXBDetId(exphit_detId).ladder();
433  int exphit_mod = PXBDetId(exphit_detId).module();
434  int dladder = abs( exphit_ladder - hit_ladder );
435  if (dladder > 10) dladder = 20 - dladder;
436  int dmodule = abs( exphit_mod - hit_mod);
437  if (dladder != 0 || dmodule != 0) {
438  continue;
439  }
440 
441  TrajectoryStateOnSurface predTrajState=expTrajMeasurements[iexp].updatedState();
442  float x=predTrajState.globalPosition().x();
443  float y=predTrajState.globalPosition().y();
444  float z=predTrajState.globalPosition().z();
445  float dxyz=sqrt((chkx-x)*(chkx-x)+(chky-y)*(chky-y)+(chkz-z)*(chkz-z));
446 
447  if (dxyz<=glmatch) {
448  glmatch=dxyz;
449  imatch=iexp;
450  imatches.push_back(int(imatch));
451  }
452 
453  } // found the propagated traj best matching the hit in data
454 
455  float lxmatch = 9999.0;
456  float lymatch = 9999.0;
457  if(!expTrajMeasurements.empty()){
458  if (glmatch<9999.) { // if there is any propagated trajectory for this hit
459  const DetId & matchhit_detId = expTrajMeasurements[imatch].recHit()->geographicalId();
460 
461  int matchhit_ladder = PXBDetId(matchhit_detId).ladder();
462  int dladder = abs(matchhit_ladder-hit_ladder);
463  if (dladder > 10) dladder = 20 - dladder;
464  LocalPoint lp = expTrajMeasurements[imatch].updatedState().localPosition();
465  lxmatch=fabs(lp.x() - chklp.x());
466  lymatch=fabs(lp.y() - chklp.y());
467  }
468  if (lxmatch < maxlxmatch_ && lymatch < maxlymatch_) {
469 
470  if (testhit->getType()!=TrackingRecHit::missing || keepOriginalMissingHit_) {
471  expTrajMeasurements.erase(expTrajMeasurements.begin()+imatch);
472  }
473 
474  }
475 
476  } //expected trajectory measurment not empty
477  }
478  }//loop on trajectory measurments tmeasColl
479 
480  //if an extrapolated hit was found but not matched to an exisitng L1 hit then push the hit back into the collection
481  //now keep the first one that is left
482  if(!expTrajMeasurements.empty()){
483  for (size_t f=0; f<expTrajMeasurements.size(); f++) {
484  TrajectoryMeasurement AddHit=expTrajMeasurements[f];
485  if (AddHit.recHit()->getType()==TrackingRecHit::missing){
486  tmeasColl.push_back(AddHit);
487  isBpixtrack = true;
488 
489  }
490 
491  }
492  }
493 
494  if(isBpixtrack || isFpixtrack){
495  if(trackref->pt()<0.6 ||
496  nStripHits<8 ||
497  fabs(trackref->dxy(bestVtx->position()))>0.05 ||
498  fabs(trackref->dz(bestVtx->position()))>0.5) continue;
499 
500  if(debug_){
501  std::cout << "isBpixtrack : " << isBpixtrack << std::endl;
502  std::cout << "isFpixtrack : " << isFpixtrack << std::endl;
503  }
504  //std::cout<<"This tracks has so many hits: "<<tmeasColl.size()<<std::endl;
505  for(std::vector<TrajectoryMeasurement>::const_iterator tmeasIt = tmeasColl.begin(); tmeasIt!=tmeasColl.end(); tmeasIt++){
506  //if(! tmeasIt->updatedState().isValid()) continue;
507  TrajectoryStateOnSurface tsos = tmeasIt->updatedState();
508 
510  if(hit->geographicalId().det() != DetId::Tracker )
511  continue;
512  else {
513 
514  // //residual
515  const DetId & hit_detId = hit->geographicalId();
516  //uint IntRawDetID = (hit_detId.rawId());
517  uint IntSubDetID = (hit_detId.subdetId());
518 
519  if(IntSubDetID == 0 ){
520  if(debug_) std::cout << "NO IntSubDetID\n";
521  continue;
522  }
523  if(IntSubDetID!=PixelSubdetector::PixelBarrel && IntSubDetID!=PixelSubdetector::PixelEndcap)
524  continue;
525 
526  int disk=0; int layer=0; int panel=0; int module=0; bool isHalfModule=false;
527 
528  const SiPixelRecHit* pixhit = dynamic_cast<const SiPixelRecHit*>(hit->hit());
529 
530  if(IntSubDetID==PixelSubdetector::PixelBarrel){ // it's a BPIX hit
531  layer = PixelBarrelName(hit_detId,pTT,isUpgrade).layerName();
532  isHalfModule = PixelBarrelName(hit_detId,pTT,isUpgrade).isHalfModule();
533 
534  if (hit->isValid()){ //fill the cluster probability in barrel
535  bool plus=true;
536  if ((PixelBarrelName(hit_detId,pTT,isUpgrade).shell()== PixelBarrelName::Shell::mO) || (PixelBarrelName(hit_detId,pTT,isUpgrade).shell()==PixelBarrelName::Shell::mI)) plus=false;
537  double clusterProbability= pixhit->clusterProbability(0);
538  if (clusterProbability!=0) fillClusterProbability(layer,0,plus,log10(clusterProbability));
539  }
540 
541  }else if(IntSubDetID==PixelSubdetector::PixelEndcap){ // it's an FPIX hit
542  disk = PixelEndcapName(hit_detId,pTT,isUpgrade).diskName();
543  panel = PixelEndcapName(hit_detId,pTT,isUpgrade).pannelName();
544  module = PixelEndcapName(hit_detId,pTT,isUpgrade).plaquetteName();
545 
546  if (hit->isValid()){
547  bool plus=true;
548  if ((PixelEndcapName(hit_detId,pTT,isUpgrade).halfCylinder()== PixelEndcapName::HalfCylinder::mO) || (PixelEndcapName(hit_detId,pTT,isUpgrade).halfCylinder()==PixelEndcapName::HalfCylinder::mI)) plus=false;
549  double clusterProbability= pixhit->clusterProbability(0);
550  if (clusterProbability!=0) fillClusterProbability(0,disk,plus,log10(clusterProbability));
551  }
552  }
553 
554  if(layer==1){
555  if(fabs(trackref->dxy(bestVtx->position()))>0.01 ||
556  fabs(trackref->dz(bestVtx->position()))>0.1) continue;
557  if(!(L2hits>0&&L3hits>0) && !(L2hits>0&&D1hits>0) && !(D1hits>0&&D2hits>0)) continue;
558  }else if(layer==2){
559  if(fabs(trackref->dxy(bestVtx->position()))>0.02 ||
560  fabs(trackref->dz(bestVtx->position()))>0.1) continue;
561  if(!(L1hits>0&&L3hits>0) && !(L1hits>0&&D1hits>0)) continue;
562  }else if(layer==3){
563  if(fabs(trackref->dxy(bestVtx->position()))>0.02 ||
564  fabs(trackref->dz(bestVtx->position()))>0.1) continue;
565  if(!(L1hits>0&&L2hits>0)) continue;
566  }else if(layer==4){
567  if(fabs(trackref->dxy(bestVtx->position()))>0.02 ||
568  fabs(trackref->dz(bestVtx->position()))>0.1) continue;
569  }else if(disk==1){
570  if(fabs(trackref->dxy(bestVtx->position()))>0.05 ||
571  fabs(trackref->dz(bestVtx->position()))>0.5) continue;
572  if(!(L1hits>0&&D2hits>0) && !(L2hits>0&&D2hits>0)) continue;
573  }else if(disk==2){
574  if(fabs(trackref->dxy(bestVtx->position()))>0.05 ||
575  fabs(trackref->dz(bestVtx->position()))>0.5) continue;
576  if(!(L1hits>0&&D1hits>0)) continue;
577  }else if(disk==3){
578  if(fabs(trackref->dxy(bestVtx->position()))>0.05 ||
579  fabs(trackref->dz(bestVtx->position()))>0.5) continue;
580  }
581 
582  //check whether hit is valid or missing using track algo flag
583  bool isHitValid =hit->hit()->getType()==TrackingRecHit::valid;
584  bool isHitMissing =hit->hit()->getType()==TrackingRecHit::missing;
585 
586  if(debug_) std::cout << "the hit is persistent\n";
587 
588  std::map<uint32_t, SiPixelHitEfficiencyModule*>::iterator pxd = theSiPixelStructure.find((*hit).geographicalId().rawId());
589 
590  // calculate alpha and beta from cluster position
592  //LocalVector localDir = ltp.momentum()/ltp.momentum().mag();
593 
594  //*************** Edge cut ********************
595  double lx=tsos.localPosition().x();
596  double ly=tsos.localPosition().y();
597 
598  if(fabs(lx)>0.55 || fabs(ly)>3.0) continue;
599 
600  bool passedFiducial=true;
601 
602  // Module fiducials:
603  if(IntSubDetID==PixelSubdetector::PixelBarrel && fabs(ly)>=3.1) passedFiducial=false;
604  if(IntSubDetID==PixelSubdetector::PixelEndcap &&
605  !((panel==1 &&
606  ((module==1 && fabs(ly)<0.7) ||
607  ((module==2 && fabs(ly)<1.1) &&
608  !(disk==-1 && ly>0.8 && lx>0.2) &&
609  !(disk==1 && ly<-0.7 && lx>0.2) &&
610  !(disk==2 && ly<-0.8)) ||
611  ((module==3 && fabs(ly)<1.5) &&
612  !(disk==-2 && lx>0.1 && ly>1.0) &&
613  !(disk==2 && lx>0.1 && ly<-1.0)) ||
614  ((module==4 && fabs(ly)<1.9) &&
615  !(disk==-2 && ly>1.5) &&
616  !(disk==2 && ly<-1.5)))) ||
617  (panel==2 &&
618  ((module==1 && fabs(ly)<0.7) ||
619  (module==2 && fabs(ly)<1.2 &&
620  !(disk>0 && ly>1.1) &&
621  !(disk<0 && ly<-1.1)) ||
622  (module==3 && fabs(ly)<1.6 &&
623  !(disk>0 && ly>1.5) &&
624  !(disk<0 && ly<-1.5)))))) passedFiducial=false;
625  if(IntSubDetID==PixelSubdetector::PixelEndcap &&
626  ((panel==1 && (module==1 || (module>=3 && abs(disk)==1))) ||
627  (panel==2 && ((module==1 && abs(disk)==2) ||
628  (module==3 && abs(disk)==1))))) passedFiducial=false;
629  // ROC fiducials:
630  double ly_mod = fabs(ly);
631  if(IntSubDetID==PixelSubdetector::PixelEndcap && (panel+module)%2==1) ly_mod=ly_mod+0.405;
632  float d_rocedge = fabs(fmod(ly_mod,0.81)-0.405);
633  if(d_rocedge<=0.0625) passedFiducial=false;
634  if(!( (IntSubDetID==PixelSubdetector::PixelBarrel &&
635  ((!isHalfModule && fabs(lx)<0.6) ||
636  (isHalfModule && lx>-0.3 && lx<0.2))) ||
637  (IntSubDetID==PixelSubdetector::PixelEndcap &&
638  ((panel==1 &&
639  ((module==1 && fabs(lx)<0.2) ||
640  (module==2 &&
641  ((fabs(lx)<0.55 && abs(disk)==1) ||
642  (lx>-0.5 && lx<0.2 && disk==-2) ||
643  (lx>-0.5 && lx<0.0 && disk==2))) ||
644  (module==3 && lx>-0.6 && lx<0.5) ||
645  (module==4 && lx>-0.3 && lx<0.15))) ||
646  (panel==2 &&
647  ((module==1 && fabs(lx)<0.6) ||
648  (module==2 &&
649  ((fabs(lx)<0.55 && abs(disk)==1) ||
650  (lx>-0.6 && lx<0.5 && abs(disk)==2))) ||
651  (module==3 && fabs(lx)<0.5))))))) passedFiducial=false;
652  if(((IntSubDetID==PixelSubdetector::PixelBarrel && !isHalfModule) ||
653  (IntSubDetID==PixelSubdetector::PixelEndcap && !(panel==1 && (module==1 || module==4)))) &&
654  fabs(lx)<0.06) passedFiducial=false;
655 
656 
657  //*************** find closest clusters ********************
658  float dx_cl[2]; float dy_cl[2]; dx_cl[0]=dx_cl[1]=dy_cl[0]=dy_cl[1]=-9999.;
660  iSetup.get<TkPixelCPERecord>().get("PixelCPEGeneric", cpEstimator);
661  if(cpEstimator.isValid()){
662  const PixelClusterParameterEstimator &cpe(*cpEstimator);
664  iSetup.get<TrackerDigiGeometryRecord>().get(tracker);
665  if(tracker.isValid()){
666  const TrackerGeometry *tkgeom=&(*tracker);
667  edm::Handle<edmNew::DetSetVector<SiPixelCluster> > clusterCollectionHandle;
668  iEvent.getByToken( clusterCollectionToken_, clusterCollectionHandle );
669  if(clusterCollectionHandle.isValid()){
670  const edmNew::DetSetVector<SiPixelCluster>& clusterCollection=*clusterCollectionHandle;
671  edmNew::DetSetVector<SiPixelCluster>::const_iterator itClusterSet=clusterCollection.begin();
672  float minD[2]; minD[0]=minD[1]=10000.;
673  for( ; itClusterSet!=clusterCollection.end(); itClusterSet++){
674  DetId detId(itClusterSet->id());
675  if(detId.rawId()!=hit->geographicalId().rawId()) continue;
676  //unsigned int sdId=detId.subdetId();
677  const PixelGeomDetUnit *pixdet=(const PixelGeomDetUnit*) tkgeom->idToDetUnit(detId);
678  edmNew::DetSet<SiPixelCluster>::const_iterator itCluster=itClusterSet->begin();
679  for( ; itCluster!=itClusterSet->end(); ++itCluster){
680  LocalPoint lp(itCluster->x(), itCluster->y(), 0.);
681  PixelClusterParameterEstimator::ReturnType params=cpe.getParameters(*itCluster,*pixdet);
682  lp=std::get<0>(params);
683  float D = sqrt((lp.x()-lx)*(lp.x()-lx)+(lp.y()-ly)*(lp.y()-ly));
684  if(D<minD[0]){
685  minD[1]=minD[0];
686  dx_cl[1]=dx_cl[0];
687  dy_cl[1]=dy_cl[0];
688  minD[0]=D;
689  dx_cl[0]=lp.x();
690  dy_cl[0]=lp.y();
691  }else if(D<minD[1]){
692  minD[1]=D;
693  dx_cl[1]=lp.x();
694  dy_cl[1]=lp.y();
695  }
696  } // loop on clusterSets
697  } // loop on clusterCollection
698  for(size_t i=0; i<2; i++){
699  if(minD[i]<9999.){
700  dx_cl[i]=fabs(dx_cl[i]-lx);
701  dy_cl[i]=fabs(dy_cl[i]-ly);
702  }
703  }
704  } // valid clusterCollectionHandle
705  } // valid tracker
706  } // valid cpEstimator
707  // distance of hit from closest cluster!
708  float d_cl[2]; d_cl[0]=d_cl[1]=-9999.;
709  if(dx_cl[0]!=-9999. && dy_cl[0]!=-9999.) d_cl[0]=sqrt(dx_cl[0]*dx_cl[0]+dy_cl[0]*dy_cl[0]);
710  if(dx_cl[1]!=-9999. && dy_cl[1]!=-9999.) d_cl[1]=sqrt(dx_cl[1]*dx_cl[1]+dy_cl[1]*dy_cl[1]);
711  if(isHitMissing && (d_cl[0]<0.05 || d_cl[1]<0.05)){ isHitMissing=0; isHitValid=1; }
712 
713  if(debug_){
714  std::cout << "Ready to add hit in histogram:\n";
715  //std::cout << "detid: "<<hit_detId<<std::endl;
716  std::cout << "isHitValid: "<<isHitValid<<std::endl;
717  std::cout << "isHitMissing: "<<isHitMissing<<std::endl;
718  //std::cout << "passedEdgeCut: "<<passedFiducial<<std::endl;
719  }
720 
721  if (nStripHits<11) continue; //Efficiency plots are filled with hits on tracks that have at least 11 Strip hits
722 
723  if(pxd!=theSiPixelStructure.end() && isHitValid && passedFiducial)
724  ++nvalid;
725  if(pxd!=theSiPixelStructure.end() && isHitMissing && passedFiducial)
726  ++nmissing;
727 
728  if (pxd!=theSiPixelStructure.end() && passedFiducial && (isHitValid || isHitMissing))
729  (*pxd).second->fill(pTT,ltp, isHitValid, modOn, ladOn, layOn, phiOn, bladeOn, diskOn, ringOn);
730 
731  //}//end if (persistent hit exists and is pixel hit)
732 
733  }//end of else
734 
735 
736  }//end for (all traj measurements of pixeltrack)
737  }//end if (is pixeltrack)
738  else
739  if(debug_) std::cout << "no pixeltrack:\n";
740 
741  }//end loop on map entries
742 }
int plaquetteName() const
plaquetteId (in pannel)
edm::EDGetTokenT< MeasurementTrackerEvent > measurementTrackerEventToken_
virtual const TrackerGeomDet * idToDetUnit(DetId) const
Return the pointer to the GeomDetUnit corresponding to a given DetId.
std::vector< TrajectoryMeasurement > measurements(const DetLayer &layer, const TrajectoryStateOnSurface &startingState, const Propagator &prop, const MeasurementEstimator &est) const
int i
Definition: DBlmapReader.cc:9
virtual void setPropagationDirection(PropagationDirection dir)
Definition: Propagator.h:144
boost::transform_iterator< IterHelp, const_IdIter > const_iterator
const_iterator end(bool update=false) const
float clusterProbability(unsigned int flags=0) const
ConstRecHitPointer const & recHit() const
const LocalTrajectoryParameters & localParameters() const
const_iterator end() const
last iterator over the map (read only)
bool getByToken(EDGetToken token, Handle< PROD > &result) const
Definition: Event.h:464
edm::EDGetTokenT< edmNew::DetSetVector< SiPixelCluster > > clusterCollectionToken_
std::map< uint32_t, SiPixelHitEfficiencyModule * > theSiPixelStructure
T y() const
Definition: PV3DBase.h:63
GlobalPoint globalPosition() const
std::vector< Vertex > VertexCollection
collection of Vertex objects
Definition: VertexFwd.h:9
unsigned int ladder() const
ladder id
Definition: PXBDetId.h:39
data_type const * const_iterator
Definition: DetSetNew.h:30
key_type key() const
Accessor for product key.
Definition: Ref.h:264
virtual void fillClusterProbability(int, int, bool, double)
id_type id(size_t cell) const
edm::EDGetTokenT< reco::VertexCollection > vertexCollectionToken_
bool isHalfModule() const
full or half module
std::shared_ptr< TrackingRecHit const > ConstRecHitPointer
T sqrt(T t)
Definition: SSEVec.h:48
edm::EDGetTokenT< TrajTrackAssociationCollection > tracksrc_
T z() const
Definition: PV3DBase.h:64
unsigned int module() const
det id
Definition: PXBDetId.h:43
Abs< T >::type abs(const T &t)
Definition: Abs.h:22
double f[11][100]
bool isValid() const
Definition: HandleBase.h:75
int subdetId() const
get the contents of the subdetector field (not cast into any detector&#39;s numbering enum) ...
Definition: DetId.h:37
Definition: DetId.h:18
DecomposeProduct< arg, typename Div::arg > D
Definition: Factorize.h:150
size_type size() const
map size
T const * product() const
Definition: Handle.h:81
const T & get() const
Definition: EventSetup.h:56
int layerName() const
layer id
T const * product() const
Definition: ESHandle.h:86
Shell shell() const
int pannelName() const
pannel id
tuple cout
Definition: gather_cfg.py:121
int diskName() const
disk id
std::pair< typename Association::data_type::first_type, double > match(Reference key, Association association, bool bestMatchByMaxValue)
Generic matching function.
Definition: Utils.h:10
const_iterator begin() const
first iterator over the map (read only)
std::tuple< LocalPoint, LocalError, SiPixelRecHitQuality::QualWordType > ReturnType
bool isValid() const
Definition: ESHandle.h:47
HalfCylinder halfCylinder() const
T x() const
Definition: PV3DBase.h:62
Definition: vlib.h:208
const_iterator begin(bool update=false) const
Our base class.
Definition: SiPixelRecHit.h:23
void SiPixelHitEfficiencySource::bookHistograms ( DQMStore::IBooker iBooker,
edm::Run const &  iRun,
edm::EventSetup const &  iSetup 
)
overridevirtual

Implements DQMEDAnalyzer.

Definition at line 186 of file SiPixelHitEfficiencySource.cc.

References bladeOn, DQMStore::IBooker::book1D(), diskOn, Exception, isUpgrade, ladOn, layOn, meClusterProbabilityD1_Minus_, meClusterProbabilityD1_Plus_, meClusterProbabilityD2_Minus_, meClusterProbabilityD2_Plus_, meClusterProbabilityL1_Minus_, meClusterProbabilityL1_Plus_, meClusterProbabilityL2_Minus_, meClusterProbabilityL2_Plus_, meClusterProbabilityL3_Minus_, meClusterProbabilityL3_Plus_, modOn, phiOn, pSet_, ringOn, MonitorElement::setAxisTitle(), DQMStore::IBooker::setCurrentFolder(), SiPixelFolderOrganizer::setModuleFolder(), and theSiPixelStructure.

186  {
187 
188  // book residual histograms in theSiPixelFolder - one (x,y) pair of histograms per det
189  SiPixelFolderOrganizer theSiPixelFolder(false);
190  for (std::map<uint32_t, SiPixelHitEfficiencyModule*>::iterator pxd = theSiPixelStructure.begin();
191  pxd!=theSiPixelStructure.end(); pxd++) {
192 
193  if(modOn){
194  if (theSiPixelFolder.setModuleFolder(iBooker,(*pxd).first,0,isUpgrade)) (*pxd).second->book(pSet_,iSetup,iBooker,0,isUpgrade);
195  else throw cms::Exception("LogicError") << "SiPixelHitEfficiencySource Folder Creation Failed! ";
196  }
197  if(ladOn){
198  if (theSiPixelFolder.setModuleFolder(iBooker,(*pxd).first,1,isUpgrade)) (*pxd).second->book(pSet_,iSetup,iBooker,1,isUpgrade);
199  else throw cms::Exception("LogicError") << "SiPixelHitEfficiencySource ladder Folder Creation Failed! ";
200  }
201  if(layOn){
202  if (theSiPixelFolder.setModuleFolder(iBooker,(*pxd).first,2,isUpgrade)) (*pxd).second->book(pSet_,iSetup,iBooker,2,isUpgrade);
203  else throw cms::Exception("LogicError") << "SiPixelHitEfficiencySource layer Folder Creation Failed! ";
204  }
205  if(phiOn){
206  if (theSiPixelFolder.setModuleFolder(iBooker,(*pxd).first,3,isUpgrade)) (*pxd).second->book(pSet_,iSetup,iBooker,3,isUpgrade);
207  else throw cms::Exception("LogicError") << "SiPixelHitEfficiencySource phi Folder Creation Failed! ";
208  }
209  if(bladeOn){
210  if (theSiPixelFolder.setModuleFolder(iBooker,(*pxd).first,4,isUpgrade)) (*pxd).second->book(pSet_,iSetup,iBooker,4,isUpgrade);
211  else throw cms::Exception("LogicError") << "SiPixelHitEfficiencySource Blade Folder Creation Failed! ";
212  }
213  if(diskOn){
214  if (theSiPixelFolder.setModuleFolder(iBooker,(*pxd).first,5,isUpgrade)) (*pxd).second->book(pSet_,iSetup,iBooker,5,isUpgrade);
215  else throw cms::Exception("LogicError") << "SiPixelHitEfficiencySource Disk Folder Creation Failed! ";
216  }
217  if(ringOn){
218  if (theSiPixelFolder.setModuleFolder(iBooker,(*pxd).first,6,isUpgrade)) (*pxd).second->book(pSet_,iSetup,iBooker,6,isUpgrade);
219  else throw cms::Exception("LogicError") << "SiPixelHitEfficiencySource Ring Folder Creation Failed! ";
220  }
221  }
222 
223  //book cluster probability histos for Barrel and Endcap
224  iBooker.setCurrentFolder("Pixel/Barrel");
225 
226  meClusterProbabilityL1_Plus_ = iBooker.book1D("ClusterProbabilityXY_Layer1_Plus","ClusterProbabilityXY_Layer1_Plus",500,-14,0.1);
227  meClusterProbabilityL1_Plus_->setAxisTitle("Log(ClusterProbability)",1);
228 
229  meClusterProbabilityL1_Minus_ = iBooker.book1D("ClusterProbabilityXY_Layer1_Minus","ClusterProbabilityXY_Layer1_Minus",500,-14,0.1);
230  meClusterProbabilityL1_Minus_->setAxisTitle("Log(ClusterProbability)",1);
231 
232  meClusterProbabilityL2_Plus_ = iBooker.book1D("ClusterProbabilityXY_Layer2_Plus","ClusterProbabilityXY_Layer2_Plus",500,-14,0.1);
233  meClusterProbabilityL2_Plus_ ->setAxisTitle("Log(ClusterProbability)",1);
234 
235  meClusterProbabilityL2_Minus_ = iBooker.book1D("ClusterProbabilityXY_Layer2_Minus","ClusterProbabilityXY_Layer2_Minus",500,-14,0.1);
236  meClusterProbabilityL2_Minus_ ->setAxisTitle("Log(ClusterProbability)",1);
237 
238  meClusterProbabilityL3_Plus_ = iBooker.book1D("ClusterProbabilityXY_Layer3_Plus","ClusterProbabilityXY_Layer3_Plus",500,-14,0.1);
239  meClusterProbabilityL3_Plus_->setAxisTitle("Log(ClusterProbability)",1);
240 
241  meClusterProbabilityL3_Minus_ = iBooker.book1D("ClusterProbabilityXY_Layer3_Minus","ClusterProbabilityXY_Layer3_Minus",500,-14,0.1);
242  meClusterProbabilityL3_Minus_->setAxisTitle("Log(ClusterProbability)",1);
243 
244  iBooker.setCurrentFolder("Pixel/Endcap");
245 
246  meClusterProbabilityD1_Plus_ = iBooker.book1D("ClusterProbabilityXY_Disk1_Plus","ClusterProbabilityXY_Disk1_Plus",500,-14,0.1);
247  meClusterProbabilityD1_Plus_ ->setAxisTitle("Log(ClusterProbability)",1);
248 
249  meClusterProbabilityD1_Minus_ = iBooker.book1D("ClusterProbabilityXY_Disk1_Minus","ClusterProbabilityXY_Disk1_Minus",500,-14,0.1);
250  meClusterProbabilityD1_Minus_->setAxisTitle("Log(ClusterProbability)",1);
251 
252  meClusterProbabilityD2_Plus_ = iBooker.book1D("ClusterProbabilityXY_Disk2_Plus","ClusterProbabilityXY_Disk2_Plus",500,-14,0.1);
253  meClusterProbabilityD2_Plus_ ->setAxisTitle("Log(ClusterProbability)",1);
254 
255  meClusterProbabilityD2_Minus_ = iBooker.book1D("ClusterProbabilityXY_Disk2_Minus","ClusterProbabilityXY_Disk2_Minus",500,-14,0.1);
256  meClusterProbabilityD2_Minus_->setAxisTitle("Log(ClusterProbability)",1);
257 
258 }
std::map< uint32_t, SiPixelHitEfficiencyModule * > theSiPixelStructure
MonitorElement * book1D(Args &&...args)
Definition: DQMStore.h:115
void setCurrentFolder(const std::string &fullpath)
Definition: DQMStore.cc:274
void setAxisTitle(const std::string &title, int axis=1)
set x-, y- or z-axis title (axis=1, 2, 3 respectively)
void SiPixelHitEfficiencySource::dqmBeginRun ( const edm::Run r,
edm::EventSetup const &  iSetup 
)
virtual

Reimplemented from DQMEDAnalyzer.

Definition at line 151 of file SiPixelHitEfficiencySource.cc.

References debug_, firstRun, edm::EventSetup::get(), python.rootplot.argparse::module, nmissing, nvalid, and theSiPixelStructure.

151  {
152  LogInfo("PixelDQM") << "SiPixelHitEfficiencySource beginRun()" << endl;
153 
154  if(firstRun){
155  // retrieve TrackerGeometry for pixel dets
156 
157  nvalid=0;
158  nmissing=0;
159 
160  firstRun = false;
161  }
162 
164  iSetup.get<TrackerDigiGeometryRecord>().get(TG);
165  if (debug_) LogVerbatim("PixelDQM") << "TrackerGeometry "<< &(*TG) <<" size is "<< TG->dets().size() << endl;
166 
167  // build theSiPixelStructure with the pixel barrel and endcap dets from TrackerGeometry
168  for (TrackerGeometry::DetContainer::const_iterator pxb = TG->detsPXB().begin();
169  pxb!=TG->detsPXB().end(); pxb++) {
170  if (dynamic_cast<PixelGeomDetUnit const *>((*pxb))!=0) {
171  SiPixelHitEfficiencyModule* module = new SiPixelHitEfficiencyModule((*pxb)->geographicalId().rawId());
172  theSiPixelStructure.insert(pair<uint32_t, SiPixelHitEfficiencyModule*>((*pxb)->geographicalId().rawId(), module));
173  }
174  }
175  for (TrackerGeometry::DetContainer::const_iterator pxf = TG->detsPXF().begin();
176  pxf!=TG->detsPXF().end(); pxf++) {
177  if (dynamic_cast<PixelGeomDetUnit const *>((*pxf))!=0) {
178  SiPixelHitEfficiencyModule* module = new SiPixelHitEfficiencyModule((*pxf)->geographicalId().rawId());
179  theSiPixelStructure.insert(pair<uint32_t, SiPixelHitEfficiencyModule*>((*pxf)->geographicalId().rawId(), module));
180  }
181  }
182  LogInfo("PixelDQM") << "SiPixelStructure size is " << theSiPixelStructure.size() << endl;
183 
184 }
std::map< uint32_t, SiPixelHitEfficiencyModule * > theSiPixelStructure
Definition: vlib.h:208
void SiPixelHitEfficiencySource::fillClusterProbability ( int  layer,
int  disk,
bool  plus,
double  probability 
)
virtual

Definition at line 115 of file SiPixelHitEfficiencySource.cc.

References MonitorElement::Fill(), meClusterProbabilityD1_Minus_, meClusterProbabilityD1_Plus_, meClusterProbabilityD2_Minus_, meClusterProbabilityD2_Plus_, meClusterProbabilityL1_Minus_, meClusterProbabilityL1_Plus_, meClusterProbabilityL2_Minus_, meClusterProbabilityL2_Plus_, meClusterProbabilityL3_Minus_, and meClusterProbabilityL3_Plus_.

Referenced by analyze().

115  {
116 
117  //barrel
118  if (layer!=0){
119  if (layer==1){
120  if (plus) meClusterProbabilityL1_Plus_->Fill(probability);
121  else meClusterProbabilityL1_Minus_->Fill(probability);
122  }
123 
124  else if (layer==2){
125  if (plus) meClusterProbabilityL2_Plus_->Fill(probability);
126  else meClusterProbabilityL2_Minus_->Fill(probability);
127  }
128 
129  else if (layer==3){
130  if (plus) meClusterProbabilityL3_Plus_->Fill(probability);
131  else meClusterProbabilityL3_Minus_->Fill(probability);
132  }
133  }
134  //Endcap
135  if (disk!=0){
136  if (disk==1){
137  if (plus) meClusterProbabilityD1_Plus_->Fill(probability);
138  else meClusterProbabilityD1_Minus_->Fill(probability);
139  }
140  if (disk==2){
141  if (plus) meClusterProbabilityD2_Plus_->Fill(probability);
142  else meClusterProbabilityD2_Minus_->Fill(probability);
143  }
144  }
145 }
void Fill(long long x)

Member Data Documentation

bool SiPixelHitEfficiencySource::applyEdgeCut_
private

Definition at line 64 of file SiPixelHitEfficiencySource.h.

Referenced by SiPixelHitEfficiencySource().

bool SiPixelHitEfficiencySource::bladeOn
private
edm::EDGetTokenT<edmNew::DetSetVector<SiPixelCluster> > SiPixelHitEfficiencySource::clusterCollectionToken_
private

Definition at line 60 of file SiPixelHitEfficiencySource.h.

Referenced by analyze(), and SiPixelHitEfficiencySource().

bool SiPixelHitEfficiencySource::debug_
private

Definition at line 67 of file SiPixelHitEfficiencySource.h.

Referenced by analyze(), dqmBeginRun(), and SiPixelHitEfficiencySource().

bool SiPixelHitEfficiencySource::diskOn
private
bool SiPixelHitEfficiencySource::firstRun
private

Definition at line 74 of file SiPixelHitEfficiencySource.h.

Referenced by dqmBeginRun(), and SiPixelHitEfficiencySource().

bool SiPixelHitEfficiencySource::isUpgrade
private

Definition at line 89 of file SiPixelHitEfficiencySource.h.

Referenced by analyze(), and bookHistograms().

bool SiPixelHitEfficiencySource::ladOn
private
bool SiPixelHitEfficiencySource::layOn
private
edm::EDGetTokenT<MeasurementTrackerEvent> SiPixelHitEfficiencySource::measurementTrackerEventToken_
private

Definition at line 62 of file SiPixelHitEfficiencySource.h.

Referenced by analyze(), and SiPixelHitEfficiencySource().

MonitorElement* SiPixelHitEfficiencySource::meClusterProbabilityD1_Minus_
private

Definition at line 102 of file SiPixelHitEfficiencySource.h.

Referenced by bookHistograms(), and fillClusterProbability().

MonitorElement* SiPixelHitEfficiencySource::meClusterProbabilityD1_Plus_
private

Definition at line 101 of file SiPixelHitEfficiencySource.h.

Referenced by bookHistograms(), and fillClusterProbability().

MonitorElement* SiPixelHitEfficiencySource::meClusterProbabilityD2_Minus_
private

Definition at line 105 of file SiPixelHitEfficiencySource.h.

Referenced by bookHistograms(), and fillClusterProbability().

MonitorElement* SiPixelHitEfficiencySource::meClusterProbabilityD2_Plus_
private

Definition at line 104 of file SiPixelHitEfficiencySource.h.

Referenced by bookHistograms(), and fillClusterProbability().

MonitorElement* SiPixelHitEfficiencySource::meClusterProbabilityL1_Minus_
private

Definition at line 93 of file SiPixelHitEfficiencySource.h.

Referenced by bookHistograms(), and fillClusterProbability().

MonitorElement* SiPixelHitEfficiencySource::meClusterProbabilityL1_Plus_
private

Definition at line 92 of file SiPixelHitEfficiencySource.h.

Referenced by bookHistograms(), and fillClusterProbability().

MonitorElement* SiPixelHitEfficiencySource::meClusterProbabilityL2_Minus_
private

Definition at line 96 of file SiPixelHitEfficiencySource.h.

Referenced by bookHistograms(), and fillClusterProbability().

MonitorElement* SiPixelHitEfficiencySource::meClusterProbabilityL2_Plus_
private

Definition at line 95 of file SiPixelHitEfficiencySource.h.

Referenced by bookHistograms(), and fillClusterProbability().

MonitorElement* SiPixelHitEfficiencySource::meClusterProbabilityL3_Minus_
private

Definition at line 99 of file SiPixelHitEfficiencySource.h.

Referenced by bookHistograms(), and fillClusterProbability().

MonitorElement* SiPixelHitEfficiencySource::meClusterProbabilityL3_Plus_
private

Definition at line 98 of file SiPixelHitEfficiencySource.h.

Referenced by bookHistograms(), and fillClusterProbability().

bool SiPixelHitEfficiencySource::modOn
private
int SiPixelHitEfficiencySource::nmissing
private

Definition at line 78 of file SiPixelHitEfficiencySource.h.

Referenced by analyze(), and dqmBeginRun().

double SiPixelHitEfficiencySource::nSigma_EdgeCut_
private

Definition at line 65 of file SiPixelHitEfficiencySource.h.

Referenced by SiPixelHitEfficiencySource().

int SiPixelHitEfficiencySource::nvalid
private

Definition at line 78 of file SiPixelHitEfficiencySource.h.

Referenced by analyze(), and dqmBeginRun().

int SiPixelHitEfficiencySource::nvtx_
private

Definition at line 80 of file SiPixelHitEfficiencySource.h.

Referenced by analyze().

bool SiPixelHitEfficiencySource::phiOn
private
edm::ParameterSet SiPixelHitEfficiencySource::pSet_
private

Definition at line 55 of file SiPixelHitEfficiencySource.h.

Referenced by bookHistograms(), and SiPixelHitEfficiencySource().

bool SiPixelHitEfficiencySource::ringOn
private
edm::InputTag SiPixelHitEfficiencySource::src_
private

Definition at line 56 of file SiPixelHitEfficiencySource.h.

std::map<uint32_t, SiPixelHitEfficiencyModule*> SiPixelHitEfficiencySource::theSiPixelStructure
private
edm::EDGetTokenT<TrajTrackAssociationCollection> SiPixelHitEfficiencySource::tracksrc_
private

Definition at line 59 of file SiPixelHitEfficiencySource.h.

Referenced by analyze(), and SiPixelHitEfficiencySource().

edm::EDGetTokenT<reco::VertexCollection> SiPixelHitEfficiencySource::vertexCollectionToken_
private

Definition at line 58 of file SiPixelHitEfficiencySource.h.

Referenced by analyze(), and SiPixelHitEfficiencySource().

double SiPixelHitEfficiencySource::vtxchi2_
private

Definition at line 87 of file SiPixelHitEfficiencySource.h.

Referenced by analyze().

double SiPixelHitEfficiencySource::vtxD0_
private

Definition at line 82 of file SiPixelHitEfficiencySource.h.

Referenced by analyze().

double SiPixelHitEfficiencySource::vtxndof_
private

Definition at line 86 of file SiPixelHitEfficiencySource.h.

Referenced by analyze().

int SiPixelHitEfficiencySource::vtxntrk_
private

Definition at line 81 of file SiPixelHitEfficiencySource.h.

Referenced by analyze().

double SiPixelHitEfficiencySource::vtxX_
private

Definition at line 83 of file SiPixelHitEfficiencySource.h.

Referenced by analyze().

double SiPixelHitEfficiencySource::vtxY_
private

Definition at line 84 of file SiPixelHitEfficiencySource.h.

Referenced by analyze().

double SiPixelHitEfficiencySource::vtxZ_
private

Definition at line 85 of file SiPixelHitEfficiencySource.h.

Referenced by analyze().