CMS 3D CMS Logo

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

#include <AlignmentStats.h>

Inheritance diagram for AlignmentStats:
edm::EDAnalyzer edm::EDConsumerBase

Public Member Functions

 AlignmentStats (const edm::ParameterSet &iConfig)
 
void analyze (const edm::Event &iEvent, const edm::EventSetup &iSetup) override
 
void beginJob () override
 
void endJob () override
 
 ~AlignmentStats () override
 
- Public Member Functions inherited from edm::EDAnalyzer
void callWhenNewProductsRegistered (std::function< void(BranchDescription const &)> const &func)
 
 EDAnalyzer ()
 
SerialTaskQueueglobalLuminosityBlocksQueue ()
 
SerialTaskQueueglobalRunsQueue ()
 
ModuleDescription const & moduleDescription () const
 
std::string workerType () const
 
 ~EDAnalyzer () 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 &&)=default
 
 EDConsumerBase (EDConsumerBase const &)=delete
 
ESProxyIndex const * esGetTokenIndices (edm::Transition iTrans) const
 
std::vector< ESProxyIndex > const & esGetTokenIndicesVector (edm::Transition iTrans) const
 
std::vector< ESRecordIndex > const & esGetTokenRecordIndicesVector (edm::Transition iTrans) const
 
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
 
EDConsumerBaseoperator= (EDConsumerBase &&)=default
 
EDConsumerBase const & operator= (EDConsumerBase const &)=delete
 
bool registeredToConsume (ProductResolverIndex, bool, BranchType) const
 
bool registeredToConsumeMany (TypeID const &, BranchType) const
 
ProductResolverIndexAndSkipBit uncheckedIndexFrom (EDGetToken) const
 
void updateLookup (BranchType iBranchType, ProductResolverIndexHelper const &, bool iPrefetchMayGet)
 
void updateLookup (eventsetup::ESRecordsToProxyIndices const &)
 
virtual ~EDConsumerBase () noexcept(false)
 

Private Types

typedef std::map< uint32_t, uint32_t > DetHitMap
 

Private Attributes

float Chi2n [MAXTRKS_]
 
float Eta [MAXTRKS_]
 
int event_
 
DetHitMap hitmap_
 
std::string hitsTreeName_
 
bool keepHitPopulation_
 
bool keepTrackStats_
 
int Nhits [MAXTRKS_][7]
 
unsigned int ntracks
 
TTree * outtree_
 
edm::InputTag overlapAM_
 
DetHitMap overlapmap_
 
float P [MAXTRKS_]
 
float Phi [MAXTRKS_]
 
uint32_t prescale_
 
float Pt [MAXTRKS_]
 
int run_
 
edm::InputTag src_
 
std::string statsTreeName_
 
uint32_t tmpPresc_
 
const TrackerGeometrytrackerGeometry_
 
const TrackerTopologytrackerTopology_
 
TFile * treefile_
 

Static Private Attributes

static const int MAXTRKS_ = 200
 

Additional Inherited Members

- Public Types inherited from edm::EDAnalyzer
typedef EDAnalyzer ModuleType
 
- Public Types inherited from edm::EDConsumerBase
typedef ProductLabels Labels
 
- Static Public Member Functions inherited from edm::EDAnalyzer
static const std::string & baseType ()
 
static void fillDescriptions (ConfigurationDescriptions &descriptions)
 
static void prevalidate (ConfigurationDescriptions &)
 
static bool wantsGlobalLuminosityBlocks ()
 
static bool wantsGlobalRuns ()
 
static bool wantsInputProcessBlocks ()
 
static bool wantsProcessBlocks ()
 
static bool wantsStreamLuminosityBlocks ()
 
static bool wantsStreamRuns ()
 
- Protected Member Functions inherited from edm::EDConsumerBase
EDGetToken consumes (const TypeToGet &id, edm::InputTag const &tag)
 
template<typename ProductType , BranchType B = InEvent>
EDGetTokenT< ProductType > consumes (edm::InputTag const &tag)
 
template<BranchType B = InEvent>
EDConsumerBaseAdaptor< B > consumes (edm::InputTag tag) noexcept
 
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 ESProduct , typename ESRecord , Transition Tr = Transition::Event>
auto esConsumes ()
 
template<Transition Tr = Transition::Event>
constexpr auto esConsumes () noexcept
 
template<typename ESProduct , typename ESRecord , Transition Tr = Transition::Event>
auto esConsumes (ESInputTag const &tag)
 
template<Transition Tr = Transition::Event>
auto esConsumes (ESInputTag tag) noexcept
 
template<Transition Tr = Transition::Event>
ESGetTokenGeneric esConsumes (eventsetup::EventSetupRecordKey const &iRecord, eventsetup::DataKey const &iKey)
 Used with EventSetupRecord::doGet. More...
 
EDGetToken mayConsume (const TypeToGet &id, edm::InputTag const &tag)
 
template<BranchType B>
EDGetToken mayConsume (const TypeToGet &id, edm::InputTag const &tag)
 
template<typename ProductType , BranchType B = InEvent>
EDGetTokenT< ProductType > mayConsume (edm::InputTag const &tag)
 

Detailed Description

Definition at line 28 of file AlignmentStats.h.

Member Typedef Documentation

◆ DetHitMap

typedef std::map<uint32_t, uint32_t> AlignmentStats::DetHitMap
private

Definition at line 58 of file AlignmentStats.h.

Constructor & Destructor Documentation

◆ AlignmentStats()

AlignmentStats::AlignmentStats ( const edm::ParameterSet iConfig)

Definition at line 28 of file AlignmentStats.cc.

29  : src_(iConfig.getParameter<edm::InputTag>("src")),
30  overlapAM_(iConfig.getParameter<edm::InputTag>("OverlapAssoMap")),
31  keepTrackStats_(iConfig.getParameter<bool>("keepTrackStats")),
32  keepHitPopulation_(iConfig.getParameter<bool>("keepHitStats")),
33  statsTreeName_(iConfig.getParameter<string>("TrkStatsFileName")),
34  hitsTreeName_(iConfig.getParameter<string>("HitStatsFileName")),
35  prescale_(iConfig.getParameter<uint32_t>("TrkStatsPrescale")) {
36  //sanity checks
37 
38  //init
39  outtree_ = nullptr;
40 
41 } //end constructor

References outtree_.

◆ ~AlignmentStats()

AlignmentStats::~AlignmentStats ( )
override

Definition at line 43 of file AlignmentStats.cc.

43  {
44  //
45 }

Member Function Documentation

◆ analyze()

void AlignmentStats::analyze ( const edm::Event iEvent,
const edm::EventSetup iSetup 
)
overridevirtual

Implements edm::EDAnalyzer.

Definition at line 80 of file AlignmentStats.cc.

80  {
81  //load list of detunits needed then in endJob
82 
83  edm::ESHandle<TrackerGeometry> tmpTkGeometry;
84  iSetup.get<TrackerDigiGeometryRecord>().get(tmpTkGeometry);
85  trackerGeometry_ = &(*tmpTkGeometry);
86 
88  iSetup.get<TrackerTopologyRcd>().get(tTopoHandle);
89  trackerTopology_ = tTopoHandle.product();
90 
91  //take trajectories and tracks to loop on
92  // edm::Handle<TrajTrackAssociationCollection> TrackAssoMap;
94  iEvent.getByLabel(src_, Tracks);
95 
96  //take overlap HitAssomap
98  iEvent.getByLabel(overlapAM_, hMap);
99  const AliClusterValueMap &OverlapMap = *hMap;
100 
101  // Initialise
102  run_ = 1;
103  event_ = 1;
104  ntracks = 0;
105  run_ = iEvent.id().run();
106  event_ = iEvent.id().event();
107  ntracks = Tracks->size();
108  // if(ntracks>1) std::cout<<"~~~~~~~~~~~~\n For this event processing "<<ntracks<<" tracks"<<std::endl;
109 
110  unsigned int trk_cnt = 0;
111 
112  for (int j = 0; j < MAXTRKS_; j++) {
113  Eta[j] = -9999.0;
114  Phi[j] = -8888.0;
115  P[j] = -7777.0;
116  Pt[j] = -6666.0;
117  Chi2n[j] = -2222.0;
118  for (int k = 0; k < 7; k++) {
119  Nhits[j][k] = 0;
120  }
121  }
122 
123  // int npxbhits=0;
124 
125  //loop on tracks
126  for (std::vector<reco::Track>::const_iterator ittrk = Tracks->begin(), edtrk = Tracks->end(); ittrk != edtrk;
127  ++ittrk) {
128  Eta[trk_cnt] = ittrk->eta();
129  Phi[trk_cnt] = ittrk->phi();
130  Chi2n[trk_cnt] = ittrk->normalizedChi2();
131  P[trk_cnt] = ittrk->p();
132  Pt[trk_cnt] = ittrk->pt();
133  Nhits[trk_cnt][0] = ittrk->numberOfValidHits();
134 
135  // if(ntracks>1)std::cout<<"Track #"<<trk_cnt+1<<" params: Eta="<< Eta[trk_cnt]<<" Phi="<< Phi[trk_cnt]<<" P="<<P[trk_cnt]<<" Nhits="<<Nhits[trk_cnt][0]<<std::endl;
136 
137  int nhit = 0;
138  //loop on tracking rechits
139  //std::cout << " loop on hits of track #" << (itt - tracks->begin()) << std::endl;
140  for (auto const &hit : ittrk->recHits()) {
141  if (!hit->isValid())
142  continue;
143  DetId detid = hit->geographicalId();
144  int subDet = detid.subdetId();
145  uint32_t rawId = hit->geographicalId().rawId();
146 
147  // if(subDet==1)npxbhits++;
148 
149  //look if you find this detid in the map
150  DetHitMap::iterator mapiter;
151  mapiter = hitmap_.find(rawId);
152  if (mapiter != hitmap_.end()) { //present, increase its value by one
153  // hitmap_[rawId]=hitmap_[rawId]+1;
154  ++(hitmap_[rawId]);
155  } else { //not present, let's add this key to the map with value=1
156  hitmap_.insert(pair<uint32_t, uint32_t>(rawId, 1));
157  }
158 
159  AlignmentClusterFlag inval;
160 
161  bool hitInPixel = (subDet == PixelSubdetector::PixelBarrel) || (subDet == PixelSubdetector::PixelEndcap);
162  bool hitInStrip = (subDet == SiStripDetId::TIB) || (subDet == SiStripDetId::TID) ||
163  (subDet == SiStripDetId::TOB) || (subDet == SiStripDetId::TEC);
164 
165  if (!(hitInPixel || hitInStrip)) {
166  //skip only this hit, don't stop everything throwing an exception
167  edm::LogError("AlignmentStats") << "Hit not belonging neither to pixels nor to strips! Skipping it. SubDet= "
168  << subDet;
169  continue;
170  }
171 
172  //check also if the hit is an overlap. If yes fill a dedicated hitmap
173  if (hitInStrip) {
174  const std::type_info &type = typeid(*hit);
175 
176  if (type == typeid(SiStripRecHit1D)) {
177  //Notice the difference respect to when one loops on Trajectories: the recHit is a TrackingRecHit and not a TransientTrackingRecHit
178  const SiStripRecHit1D *striphit = dynamic_cast<const SiStripRecHit1D *>(hit);
179  if (striphit != nullptr) {
180  SiStripRecHit1D::ClusterRef stripclust(striphit->cluster());
181  inval = OverlapMap[stripclust];
182  } else {
183  // edm::LogError("AlignmentStats")<<"ERROR in <AlignmentStats::analyze>: Dynamic cast of Strip RecHit1D failed! TypeId of the RecHit: "<<className(*hit);
184  throw cms::Exception("NullPointerError")
185  << "ERROR in <AlignmentStats::analyze>: Dynamic cast of Strip RecHit1D failed! TypeId of the RecHit: "
186  << className(*hit);
187  }
188  } //end if sistriprechit1D
189  if (type == typeid(SiStripRecHit2D)) {
190  const SiStripRecHit2D *striphit = dynamic_cast<const SiStripRecHit2D *>(hit);
191  if (striphit != nullptr) {
192  SiStripRecHit2D::ClusterRef stripclust(striphit->cluster());
193  inval = OverlapMap[stripclust];
194  //cout<<"Taken the Strip Cluster with ProdId "<<stripclust.id() <<"; the Value in the map is "<<inval<<" (DetId is "<<hit->geographicalId().rawId()<<")"<<endl;
195  } else {
196  throw cms::Exception("NullPointerError")
197  << "ERROR in <AlignmentStats::analyze>: Dynamic cast of Strip RecHit2D failed! TypeId of the RecHit: "
198  << className(*hit);
199  // edm::LogError("AlignmentStats")<<"ERROR in <AlignmentStats::analyze>: Dynamic cast of Strip RecHit2D failed! TypeId of the RecHit: "<<className(*hit);
200  }
201  } //end if sistriprechit2D
202 
203  } //end if hit in Strips
204  else {
205  const SiPixelRecHit *pixelhit = dynamic_cast<const SiPixelRecHit *>(hit);
206  if (pixelhit != nullptr) {
207  SiPixelClusterRefNew pixclust(pixelhit->cluster());
208  inval = OverlapMap[pixclust];
209  //cout<<"Taken the Pixel Cluster with ProdId "<<pixclust.id() <<"; the Value in the map is "<<inval<<" (DetId is "<<hit->geographicalId().rawId()<<")"<<endl;
210  } else {
211  edm::LogError("AlignmentStats")
212  << "ERROR in <AlignmentStats::analyze>: Dynamic cast of Pixel RecHit failed! TypeId of the RecHit: "
213  << className(*hit);
214  }
215  } //end else hit is in Pixel
216 
217  bool isOverlapHit(inval.isOverlap());
218 
219  if (isOverlapHit) {
220  //cout<<"This hit is an overlap !"<<endl;
221  DetHitMap::iterator overlapiter;
222  overlapiter = overlapmap_.find(rawId);
223 
224  if (overlapiter !=
225  overlapmap_.end()) { //the det already collected at least an overlap, increase its value by one
226  overlapmap_[rawId] = overlapmap_[rawId] + 1;
227  } else { //first overlap on det unit, let's add it to the map
228  overlapmap_.insert(pair<uint32_t, uint32_t>(rawId, 1));
229  }
230  } //end if the hit is an overlap
231 
232  int subdethit = static_cast<int>(hit->geographicalId().subdetId());
233  // if(ntracks>1)std::cout<<"Hit in SubDet="<<subdethit<<std::endl;
234  Nhits[trk_cnt][subdethit] = Nhits[trk_cnt][subdethit] + 1;
235  nhit++;
236  } //end loop on trackingrechits
237  trk_cnt++;
238 
239  } //end loop on tracks
240 
241  // cout<<"Total number of pixel hits is "<<npxbhits<<endl;
242 
243  tmpPresc_--;
244  if (tmpPresc_ < 1) {
245  outtree_->Fill();
247  }
248  if (trk_cnt != ntracks)
249  edm::LogError("AlignmentStats") << "\nERROR! trk_cnt=" << trk_cnt << " ntracks=" << ntracks;
250 
251  return;
252 }

References Chi2n, className(), SiStripRecHit1D::cluster(), SiStripRecHit2D::cluster(), Eta, event_, Exception, edm::EventSetup::get(), get, hitmap_, iEvent, AlignmentClusterFlag::isOverlap(), dqmiolumiharvest::j, dqmdumpme::k, MAXTRKS_, Nhits, ntracks, outtree_, overlapAM_, overlapmap_, Phi, PixelSubdetector::PixelBarrel, PixelSubdetector::PixelEndcap, pixelClusterTagInfos_cfi::pixelhit, prescale_, edm::ESHandle< T >::product(), Pt, run_, src_, DetId::subdetId(), SiStripDetId::TEC, SiStripDetId::TIB, SiStripDetId::TID, tmpPresc_, SiStripDetId::TOB, trackerGeometry_, trackerTopology_, and gather_cfg::Tracks.

◆ beginJob()

void AlignmentStats::beginJob ( void  )
overridevirtual

Reimplemented from edm::EDAnalyzer.

Definition at line 47 of file AlignmentStats.cc.

47  { // const edm::EventSetup &iSetup
48 
49  //book track stats tree
50  treefile_ = new TFile(statsTreeName_.c_str(), "RECREATE");
51  treefile_->cd();
52  outtree_ = new TTree("AlignmentTrackStats", "Statistics of Tracks used for Alignment");
53  // int nHitsinPXB[MAXTRKS_], nHitsinPXE[MAXTRKS_], nHitsinTEC[MAXTRKS_], nHitsinTIB[MAXTRKS_],nHitsinTOB[MAXTRKS_],nHitsinTID[MAXTRKS_];
54 
55  outtree_->Branch("Ntracks", &ntracks, "Ntracks/i");
56  outtree_->Branch("Run_", &run_, "Run_Nr/I");
57  outtree_->Branch("Event", &event_, "EventNr/I");
58  outtree_->Branch("Eta", &Eta, "Eta[Ntracks]/F");
59  outtree_->Branch("Phi", &Phi, "Phi[Ntracks]/F");
60  outtree_->Branch("P", &P, "P[Ntracks]/F");
61  outtree_->Branch("Pt", &Pt, "Pt[Ntracks]/F");
62  outtree_->Branch("Chi2n", &Chi2n, "Chi2n[Ntracks]/F");
63  outtree_->Branch("Nhits", &Nhits, "Nhits[Ntracks][7]/I");
64  /*
65  outtree_->Branch("NhitsPXB" , ,);
66  outtree_->Branch("NhitsPXE" , ,);
67  outtree_->Branch("NhitsTIB" , ,);
68  outtree_->Branch("NhitsTID" , ,);
69  outtree_->Branch("NhitsTOB" , ,);
70  outtree_->Branch("NhitsTOB" , ,);
71  */
72 
74 
75  //load the tracker geometry from the EventSetup
76  // iSetup.get<TrackerDigiGeometryRecord>().get(trackerGeometry_);
77 
78 } //end beginJob

References Chi2n, Eta, event_, Nhits, ntracks, outtree_, Phi, prescale_, Pt, run_, statsTreeName_, tmpPresc_, and treefile_.

◆ endJob()

void AlignmentStats::endJob ( void  )
overridevirtual

Reimplemented from edm::EDAnalyzer.

Definition at line 254 of file AlignmentStats.cc.

254  {
255  treefile_->cd();
256  edm::LogInfo("AlignmentStats") << "Writing out the TrackStatistics in " << gDirectory->GetPath() << std::endl;
257  outtree_->Write();
258  delete outtree_;
259 
260  //create tree with hit maps (hitstree)
261  //book track stats tree
262  TFile *hitsfile = new TFile(hitsTreeName_.c_str(), "RECREATE");
263  hitsfile->cd();
264  TTree *hitstree = new TTree("AlignmentHitMap", "Maps of Hits used for Alignment");
265 
266  unsigned int id = 0, nhits = 0, noverlaps = 0;
267  float posX(-99999.0), posY(-77777.0), posZ(-88888.0);
268  float posEta(-6666.0), posPhi(-5555.0), posR(-4444.0);
269  int subdet = 0;
270  unsigned int layer = 0;
271  bool is2D = false, isStereo = false;
272  hitstree->Branch("DetId", &id, "DetId/i");
273  hitstree->Branch("Nhits", &nhits, "Nhits/i");
274  hitstree->Branch("Noverlaps", &noverlaps, "Noverlaps/i");
275  hitstree->Branch("SubDet", &subdet, "SubDet/I");
276  hitstree->Branch("Layer", &layer, "Layer/i");
277  hitstree->Branch("is2D", &is2D, "is2D/B");
278  hitstree->Branch("isStereo", &isStereo, "isStereo/B");
279  hitstree->Branch("posX", &posX, "posX/F");
280  hitstree->Branch("posY", &posY, "posY/F");
281  hitstree->Branch("posZ", &posZ, "posZ/F");
282  hitstree->Branch("posR", &posR, "posR/F");
283  hitstree->Branch("posEta", &posEta, "posEta/F");
284  hitstree->Branch("posPhi", &posPhi, "posPhi/F");
285 
286  /*
287  TTree *overlapstree=new TTree("OverlapHitMap","Maps of Overlaps used for Alignment");
288  hitstree->Branch("DetId", &id , "DetId/i");
289  hitstree->Branch("NOverlaps", &nhits , "Nhits/i");
290  hitstree->Branch("SubDet", &subdet, "SubDet/I");
291  hitstree->Branch("Layer", &layer, "Layer/i");
292  hitstree->Branch("is2D" , &is2D, "is2D/B");
293  hitstree->Branch("isStereo",&isStereo,"isStereo/B");
294  hitstree->Branch("posX", &posX, "posX/F");
295  hitstree->Branch("posY", &posY, "posY/F");
296  hitstree->Branch("posZ", &posZ, "posZ/F");
297  hitstree->Branch("posR", &posR, "posR/F");
298  hitstree->Branch("posEta", &posEta, "posEta/F");
299  hitstree->Branch("posPhi", &posPhi, "posPhi/F");
300  */
301 
302  std::unique_ptr<AlignableTracker> theAliTracker =
303  std::make_unique<AlignableTracker>(&(*trackerGeometry_), trackerTopology_);
304  const auto &Detunitslist = theAliTracker->deepComponents();
305  int ndetunits = Detunitslist.size();
306  edm::LogInfo("AlignmentStats") << "Number of DetUnits in the AlignableTracker: " << ndetunits << std::endl;
307 
308  for (int det_cnt = 0; det_cnt < ndetunits; ++det_cnt) {
309  //re-initialize for safety
310  id = 0;
311  nhits = 0;
312  noverlaps = 0;
313  posX = -99999.0;
314  posY = -77777.0;
315  posZ = -88888.0;
316  posEta = -6666.0;
317  posPhi = -5555.0;
318  posR = -4444.0;
319  subdet = 0;
320  layer = 0;
321  is2D = false;
322  isStereo = false;
323 
324  //if detunit in vector is found also in the map, look for how many hits were collected
325  //and save in the tree this number
326  id = static_cast<uint32_t>(Detunitslist[det_cnt]->id());
327  if (hitmap_.find(id) != hitmap_.end()) {
328  nhits = hitmap_[id];
329  }
330  //if not, save nhits=0
331  else {
332  nhits = 0;
333  hitmap_.insert(pair<uint32_t, uint32_t>(id, 0));
334  }
335 
336  if (overlapmap_.find(id) != overlapmap_.end()) {
337  noverlaps = overlapmap_[id];
338  }
339  //if not, save nhits=0
340  else {
341  noverlaps = 0;
342  overlapmap_.insert(pair<uint32_t, uint32_t>(id, 0));
343  }
344 
345  //take other geometrical infos from the det
346  posX = Detunitslist[det_cnt]->globalPosition().x();
347  posY = Detunitslist[det_cnt]->globalPosition().y();
348  posZ = Detunitslist[det_cnt]->globalPosition().z();
349 
350  align::GlobalVector vec(posX, posY, posZ);
351  posR = vec.perp();
352  posPhi = vec.phi();
353  posEta = vec.eta();
354  // posPhi = atan2(posY,posX);
355 
356  DetId detid(id);
357  subdet = detid.subdetId();
358 
359  //get layers, petals, etc...
360  if (subdet == PixelSubdetector::PixelBarrel) { //PXB
361 
362  layer = trackerTopology_->pxbLayer(id);
363  is2D = true;
364  isStereo = false;
365  } else if (subdet == PixelSubdetector::PixelEndcap) {
366  layer = trackerTopology_->pxfDisk(id);
367  is2D = true;
368  isStereo = false;
369  } else if (subdet == SiStripDetId::TIB) {
370  layer = trackerTopology_->tibLayer(id);
372  isStereo = trackerTopology_->tibIsStereo(id);
373  } else if (subdet == SiStripDetId::TID) {
374  layer = trackerTopology_->tidWheel(id);
376  isStereo = trackerTopology_->tidIsStereo(id);
377  } else if (subdet == SiStripDetId::TOB) {
378  layer = trackerTopology_->tobLayer(id);
380  isStereo = trackerTopology_->tobIsStereo(id);
381  } else if (subdet == SiStripDetId::TEC) {
382  layer = trackerTopology_->tecWheel(id);
384  isStereo = trackerTopology_->tecIsStereo(id);
385  } else {
386  edm::LogError("AlignmentStats") << "Detector not belonging neither to pixels nor to strips! Skipping it. SubDet= "
387  << subdet;
388  }
389 
390  //write in the hitstree
391  hitstree->Fill();
392  } //end loop over detunits
393 
394  //save hitstree
395  hitstree->Write();
396  delete hitstree;
397  //delete Detunitslist;
398  hitmap_.clear();
399  overlapmap_.clear();
400  delete hitsfile;
401 }

References PV3DBase< T, PVType, FrameType >::eta(), hitmap_, hitsTreeName_, triggerObjects_cff::id, fastTrackerRecHitType::is2D(), nhits, outtree_, overlapmap_, PV3DBase< T, PVType, FrameType >::perp(), PV3DBase< T, PVType, FrameType >::phi(), PixelSubdetector::PixelBarrel, PixelSubdetector::PixelEndcap, RecoTauValidation_cfi::posX, RecoTauValidation_cfi::posY, TrackerTopology::pxbLayer(), TrackerTopology::pxfDisk(), DetId::subdetId(), SiStripDetId::TEC, TrackerTopology::tecIsDoubleSide(), TrackerTopology::tecIsStereo(), TrackerTopology::tecWheel(), SiStripDetId::TIB, TrackerTopology::tibIsDoubleSide(), TrackerTopology::tibIsStereo(), TrackerTopology::tibLayer(), SiStripDetId::TID, TrackerTopology::tidIsDoubleSide(), TrackerTopology::tidIsStereo(), TrackerTopology::tidWheel(), SiStripDetId::TOB, TrackerTopology::tobIsDoubleSide(), TrackerTopology::tobIsStereo(), TrackerTopology::tobLayer(), trackerGeometry_, trackerTopology_, and treefile_.

Referenced by o2olib.O2ORunMgr::executeJob().

Member Data Documentation

◆ Chi2n

float AlignmentStats::Chi2n[MAXTRKS_]
private

Definition at line 54 of file AlignmentStats.h.

Referenced by analyze(), and beginJob().

◆ Eta

float AlignmentStats::Eta[MAXTRKS_]
private

Definition at line 54 of file AlignmentStats.h.

Referenced by analyze(), and beginJob().

◆ event_

int AlignmentStats::event_
private

Definition at line 52 of file AlignmentStats.h.

Referenced by analyze(), and beginJob().

◆ hitmap_

DetHitMap AlignmentStats::hitmap_
private

Definition at line 59 of file AlignmentStats.h.

Referenced by analyze(), and endJob().

◆ hitsTreeName_

std::string AlignmentStats::hitsTreeName_
private

Definition at line 43 of file AlignmentStats.h.

Referenced by endJob().

◆ keepHitPopulation_

bool AlignmentStats::keepHitPopulation_
private

Definition at line 41 of file AlignmentStats.h.

◆ keepTrackStats_

bool AlignmentStats::keepTrackStats_
private

Definition at line 40 of file AlignmentStats.h.

◆ MAXTRKS_

const int AlignmentStats::MAXTRKS_ = 200
staticprivate

Definition at line 51 of file AlignmentStats.h.

Referenced by analyze().

◆ Nhits

int AlignmentStats::Nhits[MAXTRKS_][7]
private

Definition at line 55 of file AlignmentStats.h.

Referenced by analyze(), and beginJob().

◆ ntracks

unsigned int AlignmentStats::ntracks
private

Definition at line 53 of file AlignmentStats.h.

Referenced by analyze(), and beginJob().

◆ outtree_

TTree* AlignmentStats::outtree_
private

Definition at line 50 of file AlignmentStats.h.

Referenced by AlignmentStats(), analyze(), beginJob(), and endJob().

◆ overlapAM_

edm::InputTag AlignmentStats::overlapAM_
private

Definition at line 39 of file AlignmentStats.h.

Referenced by analyze().

◆ overlapmap_

DetHitMap AlignmentStats::overlapmap_
private

Definition at line 60 of file AlignmentStats.h.

Referenced by analyze(), and endJob().

◆ P

float AlignmentStats::P[MAXTRKS_]
private

Definition at line 54 of file AlignmentStats.h.

◆ Phi

float AlignmentStats::Phi[MAXTRKS_]
private

Definition at line 54 of file AlignmentStats.h.

Referenced by analyze(), and beginJob().

◆ prescale_

uint32_t AlignmentStats::prescale_
private

Definition at line 44 of file AlignmentStats.h.

Referenced by analyze(), and beginJob().

◆ Pt

float AlignmentStats::Pt[MAXTRKS_]
private

Definition at line 54 of file AlignmentStats.h.

Referenced by analyze(), and beginJob().

◆ run_

int AlignmentStats::run_
private

Definition at line 52 of file AlignmentStats.h.

Referenced by analyze(), and beginJob().

◆ src_

edm::InputTag AlignmentStats::src_
private

Definition at line 38 of file AlignmentStats.h.

Referenced by analyze().

◆ statsTreeName_

std::string AlignmentStats::statsTreeName_
private

Definition at line 42 of file AlignmentStats.h.

Referenced by beginJob().

◆ tmpPresc_

uint32_t AlignmentStats::tmpPresc_
private

Definition at line 46 of file AlignmentStats.h.

Referenced by analyze(), and beginJob().

◆ trackerGeometry_

const TrackerGeometry* AlignmentStats::trackerGeometry_
private

Definition at line 63 of file AlignmentStats.h.

Referenced by analyze(), and endJob().

◆ trackerTopology_

const TrackerTopology* AlignmentStats::trackerTopology_
private

Definition at line 64 of file AlignmentStats.h.

Referenced by analyze(), and endJob().

◆ treefile_

TFile* AlignmentStats::treefile_
private

Definition at line 49 of file AlignmentStats.h.

Referenced by beginJob(), and endJob().

Vector3DBase< Scalar, GlobalTag >
TrackerTopology::tobIsDoubleSide
bool tobIsDoubleSide(const DetId &id) const
Definition: TrackerTopology.h:245
edm::ESHandle::product
T const * product() const
Definition: ESHandle.h:86
AlignmentStats::trackerTopology_
const TrackerTopology * trackerTopology_
Definition: AlignmentStats.h:64
SiStripRecHit2D::cluster
ClusterRef cluster() const
Definition: SiStripRecHit2D.h:22
PixelSubdetector::PixelEndcap
Definition: PixelSubdetector.h:11
PixelSubdetector::PixelBarrel
Definition: PixelSubdetector.h:11
AlignmentStats::hitmap_
DetHitMap hitmap_
Definition: AlignmentStats.h:59
TrackerTopology::tobIsStereo
bool tobIsStereo(const DetId &id) const
Definition: TrackerTopology.h:264
TrackerTopology::tecIsDoubleSide
bool tecIsDoubleSide(const DetId &id) const
Definition: TrackerTopology.h:246
TrackerTopology::tidIsDoubleSide
bool tidIsDoubleSide(const DetId &id) const
Definition: TrackerTopology.h:250
AlignmentStats::prescale_
uint32_t prescale_
Definition: AlignmentStats.h:44
TrackerTopology::tecIsStereo
bool tecIsStereo(const DetId &id) const
Definition: TrackerTopology.h:265
AlignmentStats::Phi
float Phi[MAXTRKS_]
Definition: AlignmentStats.h:54
SiStripRecHit2D
Definition: SiStripRecHit2D.h:7
AlignmentStats::overlapAM_
edm::InputTag overlapAM_
Definition: AlignmentStats.h:39
edm::LogInfo
Log< level::Info, false > LogInfo
Definition: MessageLogger.h:125
AlignmentStats::Chi2n
float Chi2n[MAXTRKS_]
Definition: AlignmentStats.h:54
edm::Handle< reco::TrackCollection >
AlignmentStats::hitsTreeName_
std::string hitsTreeName_
Definition: AlignmentStats.h:43
SiPixelRecHit
Our base class.
Definition: SiPixelRecHit.h:23
edm::Ref
Definition: AssociativeIterator.h:58
TrackerTopology::tidWheel
unsigned int tidWheel(const DetId &id) const
Definition: TrackerTopology.h:201
AlignmentStats::outtree_
TTree * outtree_
Definition: AlignmentStats.h:50
TrackerTopology::pxbLayer
unsigned int pxbLayer(const DetId &id) const
Definition: TrackerTopology.h:144
TrackerTopology::tidIsStereo
bool tidIsStereo(const DetId &id) const
Definition: TrackerTopology.h:267
AlignmentStats::statsTreeName_
std::string statsTreeName_
Definition: AlignmentStats.h:42
AlignmentStats::MAXTRKS_
static const int MAXTRKS_
Definition: AlignmentStats.h:51
DetId
Definition: DetId.h:17
pixelClusterTagInfos_cfi.pixelhit
pixelhit
Definition: pixelClusterTagInfos_cfi.py:6
edm::EventSetup::get
T get() const
Definition: EventSetup.h:80
TrackerDigiGeometryRecord
Definition: TrackerDigiGeometryRecord.h:15
AlignmentStats::keepTrackStats_
bool keepTrackStats_
Definition: AlignmentStats.h:40
edm::ESHandle< TrackerGeometry >
TrackerTopology::tibIsStereo
bool tibIsStereo(const DetId &id) const
Definition: TrackerTopology.h:266
RecoTauValidation_cfi.posX
posX
Definition: RecoTauValidation_cfi.py:288
dqmdumpme.k
k
Definition: dqmdumpme.py:60
nhits
Definition: HIMultiTrackSelector.h:42
AlignmentStats::keepHitPopulation_
bool keepHitPopulation_
Definition: AlignmentStats.h:41
SiStripDetId::TEC
static constexpr auto TEC
Definition: SiStripDetId.h:40
DetId::subdetId
constexpr int subdetId() const
get the contents of the subdetector field (not cast into any detector's numbering enum)
Definition: DetId.h:48
AlignmentStats::src_
edm::InputTag src_
Definition: AlignmentStats.h:38
type
type
Definition: SiPixelVCal_PayloadInspector.cc:37
AlignmentStats::ntracks
unsigned int ntracks
Definition: AlignmentStats.h:53
iEvent
int iEvent
Definition: GenABIO.cc:224
gather_cfg.Tracks
Tracks
Definition: gather_cfg.py:251
TrackerTopology::pxfDisk
unsigned int pxfDisk(const DetId &id) const
Definition: TrackerTopology.h:446
AlignmentStats::Nhits
int Nhits[MAXTRKS_][7]
Definition: AlignmentStats.h:55
SiStripDetId::TOB
static constexpr auto TOB
Definition: SiStripDetId.h:39
SiStripRecHit1D::cluster
ClusterRef cluster() const
Definition: SiStripRecHit1D.h:18
AlignmentStats::Eta
float Eta[MAXTRKS_]
Definition: AlignmentStats.h:54
edm::LogError
Log< level::Error, false > LogError
Definition: MessageLogger.h:123
SiStripRecHit1D
Definition: SiStripRecHit1D.h:8
get
#define get
SiStripDetId::TID
static constexpr auto TID
Definition: SiStripDetId.h:38
TrackerTopology::tobLayer
unsigned int tobLayer(const DetId &id) const
Definition: TrackerTopology.h:147
TrackerTopology::tibIsDoubleSide
bool tibIsDoubleSide(const DetId &id) const
Definition: TrackerTopology.h:249
AlignmentStats::Pt
float Pt[MAXTRKS_]
Definition: AlignmentStats.h:54
AlignmentStats::tmpPresc_
uint32_t tmpPresc_
Definition: AlignmentStats.h:46
triggerObjects_cff.id
id
Definition: triggerObjects_cff.py:31
AlignmentStats::overlapmap_
DetHitMap overlapmap_
Definition: AlignmentStats.h:60
AlignmentStats::treefile_
TFile * treefile_
Definition: AlignmentStats.h:49
edm::ValueMap
Definition: ValueMap.h:107
Exception
Definition: hltDiff.cc:246
fastTrackerRecHitType::is2D
bool is2D(HitType hitType)
Definition: FastTrackerRecHit.h:36
SiStripDetId::TIB
static constexpr auto TIB
Definition: SiStripDetId.h:37
edm::ParameterSet::getParameter
T getParameter(std::string const &) const
Definition: ParameterSet.h:303
AlignmentClusterFlag::isOverlap
bool isOverlap() const
Definition: AlignmentClusterFlag.cc:16
AlignmentStats::run_
int run_
Definition: AlignmentStats.h:52
className
std::string className(const T &t)
Definition: ClassName.h:31
AlignmentStats::event_
int event_
Definition: AlignmentStats.h:52
TrackerTopologyRcd
Definition: TrackerTopologyRcd.h:10
dqmiolumiharvest.j
j
Definition: dqmiolumiharvest.py:66
P
std::pair< OmniClusterRef, TrackingParticleRef > P
Definition: BDHadronTrackMonitoringAnalyzer.cc:202
TrackerTopology::tecWheel
unsigned int tecWheel(const DetId &id) const
Definition: TrackerTopology.h:198
edm::InputTag
Definition: InputTag.h:15
AlignmentClusterFlag
Definition: AlignmentClusterFlag.h:15
AlignmentStats::trackerGeometry_
const TrackerGeometry * trackerGeometry_
Definition: AlignmentStats.h:63
RecoTauValidation_cfi.posY
posY
Definition: RecoTauValidation_cfi.py:289
hit
Definition: SiStripHitEffFromCalibTree.cc:88
TrackerTopology::tibLayer
unsigned int tibLayer(const DetId &id) const
Definition: TrackerTopology.h:150