CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
TrackerDpgAnalysis.cc
Go to the documentation of this file.
1 // -*- C++ -*-
2 //
3 // Package: DPGAnalysis
4 // Class: TrackerDpgAnalysis
5 //
13 //
14 // Original Author: Christophe DELAERE
15 // Created: Tue Sep 23 02:11:44 CEST 2008
16 // Revised: Thu Nov 26 10:00:00 CEST 2009
17 // part of the code was inspired by http://cmssw.cvs.cern.ch/cgi-bin/cmssw.cgi/UserCode/YGao/LhcTrackAnalyzer/
18 // part of the code was inspired by
19 // other inputs from Andrea Giammanco, Gaelle Boudoul, Andrea Venturi, Steven Lowette, Gavril Giurgiu
20 // $Id: TrackerDpgAnalysis.cc,v 1.14 2013/02/27 19:49:47 wmtan Exp $
21 //
22 //
23 
24 // system include files
25 #include <memory>
26 #include <iostream>
27 #include <limits>
28 #include <utility>
29 #include <vector>
30 #include <algorithm>
31 #include <functional>
32 #include <string.h>
33 #include <sstream>
34 #include <fstream>
35 
36 // root include files
37 #include "TTree.h"
38 #include "TFile.h"
39 
40 // user include files
100 
101 // topology
103 
104 //
105 // class decleration
106 //
108 
110  public:
111  explicit TrackerDpgAnalysis(const edm::ParameterSet&);
113 
114  protected:
115  std::vector<double> onTrackAngles(edm::Handle<edmNew::DetSetVector<SiStripCluster> >&,const std::vector<Trajectory>& );
116  void insertMeasurement(std::multimap<const uint32_t,std::pair<LocalPoint,double> >&, const TransientTrackingRecHit*,double);
117  std::vector<int> onTrack(edm::Handle<edmNew::DetSetVector<SiStripCluster> >&,const reco::TrackCollection&, uint32_t );
118  void insertMeasurement(std::multimap<const uint32_t,std::pair<int,int> >&, const TrackingRecHit*,int);
119  std::map<size_t,int> inVertex(const reco::TrackCollection&, const reco::VertexCollection&, uint32_t);
120  std::vector<std::pair<double,double> > onTrackAngles(edm::Handle<edmNew::DetSetVector<SiPixelCluster> >&,const std::vector<Trajectory>& );
121  void insertMeasurement(std::multimap<const uint32_t,std::pair<LocalPoint,std::pair<double,double> > >&, const TransientTrackingRecHit*,double,double);
122  std::vector<int> onTrack(edm::Handle<edmNew::DetSetVector<SiPixelCluster> >&,const reco::TrackCollection&, uint32_t );
123  void insertMeasurement(std::multimap<const uint32_t,std::pair<std::pair<float, float>,int> >&, const TrackingRecHit*,int);
124  std::string toStringName(uint32_t, const TrackerTopology*);
125  std::string toStringId(uint32_t);
126  double sumPtSquared(const reco::Vertex&);
127  float delay(const SiStripEventSummary&);
128  std::map<uint32_t,float> delay(const std::vector<std::string>&);
129 
130  private:
131  virtual void beginRun(const edm::Run&, const edm::EventSetup&) override;
132  virtual void analyze(const edm::Event&, const edm::EventSetup&) override;
133  virtual void endJob() override ;
134 
135  // ----------member data ---------------------------
136  static const int nMaxPVs_ = 50;
139  std::vector<edm::InputTag> trackLabel_;
142  std::multimap<const uint32_t,const FedChannelConnection*> connections_;
145  TTree* clusters_;
146  TTree* pixclusters_;
147  std::vector<TTree*> tracks_;
148  std::vector<TTree*> missingHits_;
149  TTree* vertices_;
151  TTree* event_;
152  TTree* psumap_;
153  TTree* readoutmap_;
154  bool onTrack_;
156  uint32_t globalvertexid_;
165  float eta_, phi_, chi2_;
167  uint32_t detid_, dcuId_, type_;
170  uint32_t *ntracks_, *ntrajs_;
173  uint32_t nTracks_pvtx_;
182  float charge_, p_, pt_;
190  std::vector<std::string> delayFileNames_;
192  std::vector<std::string> hlNames_; // name of each HLT algorithm
193  HLTConfigProvider hltConfig_; // to get configuration for L1s/Pre
194 
195 };
196 
197 //
198 // constructors and destructor
199 //
201 {
202  // members
203  moduleName_ = new char[256];
204  moduleId_ = new char[256];
205  PSUname_ = new char[256];
206  pset_ = iConfig;
207 
208  // enable/disable functionalities
209  functionality_offtrackClusters_ = iConfig.getUntrackedParameter<bool>("keepOfftrackClusters",true);
210  functionality_ontrackClusters_ = iConfig.getUntrackedParameter<bool>("keepOntrackClusters",true);
211  functionality_pixclusters_ = iConfig.getUntrackedParameter<bool>("keepPixelClusters",true);
212  functionality_pixvertices_ = iConfig.getUntrackedParameter<bool>("keepPixelVertices",true);
213  functionality_missingHits_ = iConfig.getUntrackedParameter<bool>("keepMissingHits",true);
214  functionality_tracks_ = iConfig.getUntrackedParameter<bool>("keepTracks",true);
215  functionality_vertices_ = iConfig.getUntrackedParameter<bool>("keepVertices",true);
216  functionality_events_ = iConfig.getUntrackedParameter<bool>("keepEvents",true);
217 
218  // parameters
219  clusterLabel_ = iConfig.getParameter<edm::InputTag>("ClustersLabel");
220  pixelclusterLabel_ = iConfig.getParameter<edm::InputTag>("PixelClustersLabel");
221  trackLabel_ = iConfig.getParameter<std::vector<edm::InputTag> >("TracksLabel");
222  dedx1Label_ = iConfig.getParameter<edm::InputTag>("DeDx1Label");
223  dedx2Label_ = iConfig.getParameter<edm::InputTag>("DeDx2Label");
224  dedx3Label_ = iConfig.getParameter<edm::InputTag>("DeDx3Label");
225  vertexLabel_ = iConfig.getParameter<edm::InputTag>("vertexLabel");
226  pixelVertexLabel_ = iConfig.getParameter<edm::InputTag>("pixelVertexLabel");
227  bsLabel_ = iConfig.getParameter<edm::InputTag>("beamSpotLabel");
228  L1Label_ = iConfig.getParameter<edm::InputTag>("L1Label");
229  HLTLabel_ = iConfig.getParameter<edm::InputTag>("HLTLabel");
230 
231  // initialize arrays
232  ntracks_ = new uint32_t[trackLabel_.size()];
233  ntrajs_ = new uint32_t[trackLabel_.size()];
234  globaltrackid_ = new uint32_t[trackLabel_.size()];
235  trackid_ = new uint32_t[trackLabel_.size()];
236  lowPixelProbabilityFraction_ = new float[trackLabel_.size()];
237  globalvertexid_ = iConfig.getParameter<uint32_t>("InitalCounter");
238  for(size_t i = 0; i<trackLabel_.size();++i) {
239  ntracks_[i]=0;
240  ntrajs_[i]=0;
241  globaltrackid_[i]=iConfig.getParameter<uint32_t>("InitalCounter");
242  trackid_[i]=0;
244  }
245 
246  // create output
248  TFileDirectory* dir = new TFileDirectory(fileService->mkdir("trackerDPG"));
249 
250  // create a TTree for clusters
251  clusters_ = dir->make<TTree>("clusters","cluster information");
252  clusters_->Branch("eventid",&eventid_,"eventid/i");
253  clusters_->Branch("runid",&runid_,"runid/i");
254  for(size_t i = 0; i<trackLabel_.size(); ++i) {
255  char buffer1[256];
256  char buffer2[256];
257  sprintf(buffer1,"trackid%lu",(unsigned long)i);
258  sprintf(buffer2,"trackid%lu/i",(unsigned long)i);
259  clusters_->Branch(buffer1,trackid_+i,buffer2);
260  }
261  clusters_->Branch("onTrack",&onTrack_,"onTrack/O");
262  clusters_->Branch("clWidth",&clWidth_,"clWidth/F");
263  clusters_->Branch("clPosition",&clPosition_,"clPosition/F");
264  clusters_->Branch("clglobalX",&globalX_,"clglobalX/F");
265  clusters_->Branch("clglobalY",&globalY_,"clglobalY/F");
266  clusters_->Branch("clglobalZ",&globalZ_,"clglobalZ/F");
267  clusters_->Branch("angle",&angle_,"angle/F");
268  clusters_->Branch("thickness",&thickness_,"thickness/F");
269  clusters_->Branch("maxCharge",&maxCharge_,"maxCharge/F");
270  clusters_->Branch("clNormalizedCharge",&clNormalizedCharge_,"clNormalizedCharge/F");
271  clusters_->Branch("clNormalizedNoise",&clNormalizedNoise_,"clNormalizedNoise/F");
272  clusters_->Branch("clSignalOverNoise",&clSignalOverNoise_,"clSignalOverNoise/F");
273  clusters_->Branch("clCorrectedCharge",&clCorrectedCharge_,"clCorrectedCharge/F");
274  clusters_->Branch("clCorrectedSignalOverNoise",&clCorrectedSignalOverNoise_,"clCorrectedSignalOverNoise/F");
275  clusters_->Branch("clBareCharge",&clBareCharge_,"clBareCharge/F");
276  clusters_->Branch("clBareNoise",&clBareNoise_,"clBareNoise/F");
277  clusters_->Branch("stripLength",&stripLength_,"stripLength/F");
278  clusters_->Branch("detid",&detid_,"detid/i");
279  clusters_->Branch("lldChannel",&lldChannel_,"lldChannel/s");
280 
281  // create a TTree for pixel clusters
282  pixclusters_ = dir->make<TTree>("pixclusters","pixel cluster information");
283  pixclusters_->Branch("eventid",&eventid_,"eventid/i");
284  pixclusters_->Branch("runid",&runid_,"runid/i");
285  for(size_t i = 0; i<trackLabel_.size(); ++i) {
286  char buffer1[256];
287  char buffer2[256];
288  sprintf(buffer1,"trackid%lu",(unsigned long)i);
289  sprintf(buffer2,"trackid%lu/i",(unsigned long)i);
290  pixclusters_->Branch(buffer1,trackid_+i,buffer2);
291  }
292  pixclusters_->Branch("onTrack",&onTrack_,"onTrack/O");
293  pixclusters_->Branch("clPositionX",&clPositionX_,"clPositionX/F");
294  pixclusters_->Branch("clPositionY",&clPositionY_,"clPositionY/F");
295  pixclusters_->Branch("clSize",&clSize_,"clSize/i");
296  pixclusters_->Branch("clSizeX",&clSizeX_,"clSizeX/i");
297  pixclusters_->Branch("clSizeY",&clSizeY_,"clSizeY/i");
298  pixclusters_->Branch("alpha",&alpha_,"alpha/F");
299  pixclusters_->Branch("beta",&beta_,"beta/F");
300  pixclusters_->Branch("charge",&charge_,"charge/F");
301  pixclusters_->Branch("chargeCorr",&chargeCorr_,"chargeCorr/F");
302  pixclusters_->Branch("clglobalX",&globalX_,"clglobalX/F");
303  pixclusters_->Branch("clglobalY",&globalY_,"clglobalY/F");
304  pixclusters_->Branch("clglobalZ",&globalZ_,"clglobalZ/F");
305  pixclusters_->Branch("detid",&detid_,"detid/i");
306 
307  // create a tree for tracks
308  for(size_t i = 0; i<trackLabel_.size(); ++i) {
309  char buffer1[256];
310  char buffer2[256];
311  sprintf(buffer1,"tracks%lu",(unsigned long)i);
312  sprintf(buffer2,"track%lu information",(unsigned long)i);
313  TTree* thetracks_ = dir->make<TTree>(buffer1,buffer2);
314  sprintf(buffer1,"trackid%lu",(unsigned long)i);
315  sprintf(buffer2,"trackid%lu/i",(unsigned long)i);
316  thetracks_->Branch(buffer1,globaltrackid_+i,buffer2);
317  thetracks_->Branch("eventid",&eventid_,"eventid/i");
318  thetracks_->Branch("runid",&runid_,"runid/i");
319  thetracks_->Branch("chi2",&chi2_,"chi2/F");
320  thetracks_->Branch("eta",&eta_,"eta/F");
321  thetracks_->Branch("etaerr",&etaerr_,"etaerr/F");
322  thetracks_->Branch("phi",&phi_,"phi/F");
323  thetracks_->Branch("phierr",&phierr_,"phierr/F");
324  thetracks_->Branch("dedx1",&dedx1_,"dedx1/F");
325  thetracks_->Branch("dedx2",&dedx2_,"dedx2/F");
326  thetracks_->Branch("dedx3",&dedx3_,"dedx3/F");
327  thetracks_->Branch("dedxNoM",&dedxNoM_,"dedxNoM/i");
328  thetracks_->Branch("charge",&charge_,"charge/F");
329  thetracks_->Branch("quality",&quality_,"quality/i");
330  thetracks_->Branch("foundhits",&foundhits_,"foundhits/i");
331  thetracks_->Branch("lostHits",&lostHits_,"lostHits/i");
332  thetracks_->Branch("foundhitsStrips",&foundhitsStrips_,"foundhitsStrips/i");
333  thetracks_->Branch("foundhitsPixels",&foundhitsPixels_,"foundhitsPixels/i");
334  thetracks_->Branch("losthitsStrips",&losthitsStrips_,"losthitsStrips/i");
335  thetracks_->Branch("losthitsPixels",&losthitsPixels_,"losthitsPixels/i");
336  thetracks_->Branch("p",&p_,"p/F");
337  thetracks_->Branch("pt",&pt_,"pt/F");
338  thetracks_->Branch("pterr",&pterr_,"pterr/F");
339  thetracks_->Branch("ndof",&ndof_,"ndof/i");
340  thetracks_->Branch("dz",&dz_,"dz/F");
341  thetracks_->Branch("dzerr",&dzerr_,"dzerr/F");
342  thetracks_->Branch("dzCorr",&dzCorr_,"dzCorr/F");
343  thetracks_->Branch("dxy",&dxy_,"dxy/F");
344  thetracks_->Branch("dxyerr",&dxyerr_,"dxyerr/F");
345  thetracks_->Branch("dxyCorr",&dxyCorr_,"dxyCorr/F");
346  thetracks_->Branch("qoverp",&qoverp_,"qoverp/F");
347  thetracks_->Branch("xPCA",&xPCA_,"xPCA/F");
348  thetracks_->Branch("yPCA",&yPCA_,"yPCA/F");
349  thetracks_->Branch("zPCA",&zPCA_,"zPCA/F");
350  thetracks_->Branch("nLayers",&nLayers_,"nLayers/i");
351  thetracks_->Branch("trkWeightpvtx",&trkWeightpvtx_,"trkWeightpvtx/F");
352  thetracks_->Branch("vertexid",&vertexid_,"vertexid/i");
353  tracks_.push_back(thetracks_);
354  }
355 
356  // create a tree for missing hits
357  for(size_t i = 0; i<trackLabel_.size(); ++i) {
358  char buffer1[256];
359  char buffer2[256];
360  sprintf(buffer1,"misingHits%lu",(unsigned long)i);
361  sprintf(buffer2,"missing hits from track collection %lu",(unsigned long)i);
362  TTree* themissingHits_ = dir->make<TTree>(buffer1,buffer2);
363  sprintf(buffer1,"trackid%lu",(unsigned long)i);
364  sprintf(buffer2,"trackid%lu/i",(unsigned long)i);
365  themissingHits_->Branch(buffer1,globaltrackid_+i,buffer2);
366  themissingHits_->Branch("eventid",&eventid_,"eventid/i");
367  themissingHits_->Branch("runid",&runid_,"runid/i");
368  themissingHits_->Branch("detid",&detid_,"detid/i");
369  themissingHits_->Branch("type",&type_,"type/i");
370  themissingHits_->Branch("localX",&clPositionX_,"localX/F");
371  themissingHits_->Branch("localY",&clPositionY_,"localY/F");
372  themissingHits_->Branch("globalX",&globalX_,"globalX/F");
373  themissingHits_->Branch("globalY",&globalY_,"globalY/F");
374  themissingHits_->Branch("globalZ",&globalZ_,"globalZ/F");
375  themissingHits_->Branch("measX",&measX_,"measX/F");
376  themissingHits_->Branch("measY",&measY_,"measY/F");
377  themissingHits_->Branch("errorX",&errorX_,"errorX/F");
378  themissingHits_->Branch("errorY",&errorY_,"errorY/F");
379  missingHits_.push_back(themissingHits_);
380  }
381 
382  // create a tree for the vertices
383  vertices_ = dir->make<TTree>("vertices","vertex information");
384  vertices_->Branch("vertexid",&globalvertexid_,"vertexid/i");
385  vertices_->Branch("eventid",&eventid_,"eventid/i");
386  vertices_->Branch("runid",&runid_,"runid/i");
387  vertices_->Branch("nTracks",&nTracks_pvtx_,"nTracks/i");
388  vertices_->Branch("sumptsq",&sumptsq_pvtx_,"sumptsq/F");
389  vertices_->Branch("isValid",&isValid_pvtx_,"isValid/O");
390  vertices_->Branch("isFake",&isFake_pvtx_,"isFake/O");
391  vertices_->Branch("recx",&recx_pvtx_,"recx/F");
392  vertices_->Branch("recy",&recy_pvtx_,"recy/F");
393  vertices_->Branch("recz",&recz_pvtx_,"recz/F");
394  vertices_->Branch("recx_err",&recx_err_pvtx_,"recx_err/F");
395  vertices_->Branch("recy_err",&recy_err_pvtx_,"recy_err/F");
396  vertices_->Branch("recz_err",&recz_err_pvtx_,"recz_err/F");
397 
398  // create a tree for the vertices
399  pixelVertices_ = dir->make<TTree>("pixelVertices","pixel vertex information");
400  pixelVertices_->Branch("eventid",&eventid_,"eventid/i");
401  pixelVertices_->Branch("runid",&runid_,"runid/i");
402  pixelVertices_->Branch("nTracks",&nTracks_pvtx_,"nTracks/i");
403  pixelVertices_->Branch("sumptsq",&sumptsq_pvtx_,"sumptsq/F");
404  pixelVertices_->Branch("isValid",&isValid_pvtx_,"isValid/O");
405  pixelVertices_->Branch("isFake",&isFake_pvtx_,"isFake/O");
406  pixelVertices_->Branch("recx",&recx_pvtx_,"recx/F");
407  pixelVertices_->Branch("recy",&recy_pvtx_,"recy/F");
408  pixelVertices_->Branch("recz",&recz_pvtx_,"recz/F");
409  pixelVertices_->Branch("recx_err",&recx_err_pvtx_,"recx_err/F");
410  pixelVertices_->Branch("recy_err",&recy_err_pvtx_,"recy_err/F");
411  pixelVertices_->Branch("recz_err",&recz_err_pvtx_,"recz_err/F");
412 
413  // create a tree for the events
414  event_ = dir->make<TTree>("events","event information");
415  event_->Branch("eventid",&eventid_,"eventid/i");
416  event_->Branch("runid",&runid_,"runid/i");
417  event_->Branch("L1DecisionBits",L1DecisionBits_,"L1DecisionBits[192]/O");
418  event_->Branch("L1TechnicalBits",L1TechnicalBits_,"L1TechnicalBits[64]/O");
419  event_->Branch("orbit",&orbit_,"orbit/i");
420  event_->Branch("orbitL1",&orbitL1_,"orbitL1/i");
421  event_->Branch("bx",&bx_,"bx/i");
422  event_->Branch("store",&store_,"store/i");
423  event_->Branch("time",&time_,"time/i");
424  event_->Branch("delay",&delay_,"delay/F");
425  event_->Branch("lumiSegment",&lumiSegment_,"lumiSegment/s");
426  event_->Branch("physicsDeclared",&physicsDeclared_,"physicsDeclared/s");
427  event_->Branch("HLTDecisionBits",HLTDecisionBits_,"HLTDecisionBits[256]/O");
428  char buffer[256];
429  sprintf(buffer,"ntracks[%lu]/i",(unsigned long)trackLabel_.size());
430  event_->Branch("ntracks",ntracks_,buffer);
431  sprintf(buffer,"ntrajs[%lu]/i",(unsigned long)trackLabel_.size());
432  event_->Branch("ntrajs",ntrajs_,buffer);
433  sprintf(buffer,"lowPixelProbabilityFraction[%lu]/F",(unsigned long)trackLabel_.size());
434  event_->Branch("lowPixelProbabilityFraction",lowPixelProbabilityFraction_,buffer);
435  event_->Branch("nclusters",&nclusters_,"nclusters/i");
436  event_->Branch("npixClusters",&npixClusters_,"npixClusters/i");
437  event_->Branch("nclustersOntrack",&nclustersOntrack_,"nclustersOntrack/i");
438  event_->Branch("npixClustersOntrack",&npixClustersOntrack_,"npixClustersOntrack/i");
439  event_->Branch("bsX0",&bsX0_,"bsX0/F");
440  event_->Branch("bsY0",&bsY0_,"bsY0/F");
441  event_->Branch("bsZ0",&bsZ0_,"bsZ0/F");
442  event_->Branch("bsSigmaZ",&bsSigmaZ_,"bsSigmaZ/F");
443  event_->Branch("bsDxdz",&bsDxdz_,"bsDxdz/F");
444  event_->Branch("bsDydz",&bsDydz_,"bsDydz/F");
445  event_->Branch("nVertices",&nVertices_,"nVertices/i");
446  event_->Branch("thrustValue",&thrustValue_,"thrustValue/F");
447  event_->Branch("thrustX",&thrustX_,"thrustX/F");
448  event_->Branch("thrustY",&thrustY_,"thrustY/F");
449  event_->Branch("thrustZ",&thrustZ_,"thrustZ/F");
450  event_->Branch("sphericity",&sphericity_,"sphericity/F");
451  event_->Branch("planarity",&planarity_,"planarity/F");
452  event_->Branch("aplanarity",&aplanarity_,"aplanarity/F");
453  event_->Branch("MagneticField",&fBz_,"MagneticField/F");
454 
455  // cabling
456  cablingFileName_ = iConfig.getUntrackedParameter<std::string>("PSUFileName","PSUmapping.csv");
457  delayFileNames_ = iConfig.getUntrackedParameter<std::vector<std::string> >("DelayFileNames",std::vector<std::string>(0));
458  psumap_ = dir->make<TTree>("psumap","PSU map");
459  psumap_->Branch("PSUname",PSUname_,"PSUname/C");
460  psumap_->Branch("dcuId",&dcuId_,"dcuId/i");
461  readoutmap_ = dir->make<TTree>("readoutMap","cabling map");
462  readoutmap_->Branch("detid",&detid_,"detid/i");
463  readoutmap_->Branch("dcuId",&dcuId_,"dcuId/i");
464  readoutmap_->Branch("fecCrate",&fecCrate_,"fecCrate/s");
465  readoutmap_->Branch("fecSlot",&fecSlot_,"fecSlot/s");
466  readoutmap_->Branch("fecRing",&fecRing_,"fecRing/s");
467  readoutmap_->Branch("ccuAdd",&ccuAdd_,"ccuAdd/s");
468  readoutmap_->Branch("ccuChan",&ccuChan_,"ccuChan/s");
469  readoutmap_->Branch("lldChannel",&lldChannel_,"lldChannel/s");
470  readoutmap_->Branch("fedId",&fedId_,"fedId/s");
471  readoutmap_->Branch("fedCh",&fedCh_,"fedCh/s");
472  readoutmap_->Branch("fiberLength",&fiberLength_,"fiberLength/s");
473  readoutmap_->Branch("moduleName",moduleName_,"moduleName/C");
474  readoutmap_->Branch("moduleId",moduleId_,"moduleId/C");
475  readoutmap_->Branch("delay",&delay_,"delay/F");
476  readoutmap_->Branch("globalX",&globalX_,"globalX/F");
477  readoutmap_->Branch("globalY",&globalY_,"globalY/F");
478  readoutmap_->Branch("globalZ",&globalZ_,"globalZ/F");
479 }
480 
482 {
483  delete[] moduleName_;
484  delete[] moduleId_;
485 }
486 
487 //
488 // member functions
489 //
490 
491 // ------------ method called to for each event ------------
492 void
494 {
495  using namespace edm;
496  using namespace reco;
497  using namespace std;
498  using reco::TrackCollection;
499 
500  // load event info
501  eventid_ = iEvent.id().event();
502  runid_ = iEvent.id().run();
503  bx_ = iEvent.eventAuxiliary().bunchCrossing();
504  orbit_ = iEvent.eventAuxiliary().orbitNumber();
505  store_ = iEvent.eventAuxiliary().storeNumber();
506  time_ = iEvent.eventAuxiliary().time().value();
508 
509  // Retrieve commissioning information from "event summary", when available (for standard fine delay)
511  iEvent.getByLabel( "siStripDigis", summary );
512  if(summary.isValid())
513  delay_ = delay(*summary.product());
514  else
515  delay_ = 0.;
516 
517  // -- Magnetic field
519  iSetup.get<IdealMagneticFieldRecord>().get(MF);
520  const MagneticField* theMagneticField = MF.product();
521  fBz_ = fabs(theMagneticField->inTesla(GlobalPoint(0,0,0)).z());
522 
523  // load trigger info
525  iEvent.getByLabel(L1Label_, gtrr_handle);
526  L1GlobalTriggerReadoutRecord const* gtrr = gtrr_handle.product();
527  L1GtFdlWord fdlWord = gtrr->gtFdlWord();
528  DecisionWord L1decision = fdlWord.gtDecisionWord();
529  for(int bit=0;bit<128;++bit) {
530  L1DecisionBits_[bit] = L1decision[bit];
531  }
532  DecisionWordExtended L1decisionE = fdlWord.gtDecisionWordExtended();
533  for(int bit=0;bit<64;++bit) {
534  L1DecisionBits_[bit+128] = L1decisionE[bit];
535  }
536  TechnicalTriggerWord L1technical = fdlWord.gtTechnicalTriggerWord();
537  for(int bit=0;bit<64;++bit) {
538  L1TechnicalBits_[bit] = L1technical[bit];
539  }
540  orbitL1_ = fdlWord.orbitNr();
541  physicsDeclared_ = fdlWord.physicsDeclared();
543  iEvent.getByLabel(HLTLabel_, trh);
544  size_t ntrh = trh->size();
545  for(size_t bit=0;bit<256;++bit)
546  HLTDecisionBits_[bit] = bit<ntrh ? (bool)(trh->accept(bit)): false;
547 
548  // load beamspot
549  edm::Handle<reco::BeamSpot> recoBeamSpotHandle;
550  iEvent.getByLabel(bsLabel_,recoBeamSpotHandle);
551  reco::BeamSpot bs = *recoBeamSpotHandle;
552  const Point beamSpot = recoBeamSpotHandle.isValid() ?
553  Point(recoBeamSpotHandle->x0(), recoBeamSpotHandle->y0(), recoBeamSpotHandle->z0()) :
554  Point(0, 0, 0);
555  if(recoBeamSpotHandle.isValid()) {
556  bsX0_ = bs.x0();
557  bsY0_ = bs.y0();
558  bsZ0_ = bs.z0();
559  bsSigmaZ_ = bs.sigmaZ();
560  bsDxdz_ = bs.dxdz();
561  bsDydz_ = bs.dydz();
562  } else {
563  bsX0_ = 0.;
564  bsY0_ = 0.;
565  bsZ0_ = 0.;
566  bsSigmaZ_ = 0.;
567  bsDxdz_ = 0.;
568  bsDydz_ = 0.;
569  }
570 
571  // load primary vertex
572  static const reco::VertexCollection s_empty_vertexColl;
573  edm::Handle<reco::VertexCollection> vertexCollectionHandle;
574  iEvent.getByLabel(vertexLabel_,vertexCollectionHandle);
575  const reco::VertexCollection vertexColl = *(vertexCollectionHandle.product());
576  nVertices_ = 0;
577  for(reco::VertexCollection::const_iterator v=vertexColl.begin();
578  v!=vertexColl.end(); ++v) {
579  if(v->isValid() && !v->isFake()) ++nVertices_;
580  }
581 
582  // load pixel vertices
583  // Pixel vertices are handled as primary vertices, but not linked to tracks.
584  edm::Handle<reco::VertexCollection> pixelVertexCollectionHandle;
585  iEvent.getByLabel(pixelVertexLabel_, pixelVertexCollectionHandle);
586  const reco::VertexCollection pixelVertexColl = *(pixelVertexCollectionHandle.product());
587  nPixelVertices_ = pixelVertexColl.size();
588 
589  // load the clusters
591  iEvent.getByLabel(clusterLabel_,clusters);
593  iEvent.getByLabel(pixelclusterLabel_,pixelclusters );
594 
595  // load dedx info
596  Handle<ValueMap<DeDxData> > dEdx1Handle;
597  Handle<ValueMap<DeDxData> > dEdx2Handle;
598  Handle<ValueMap<DeDxData> > dEdx3Handle;
599  try {iEvent.getByLabel(dedx1Label_, dEdx1Handle);} catch ( cms::Exception& ) {;}
600  try {iEvent.getByLabel(dedx2Label_, dEdx2Handle);} catch ( cms::Exception& ) {;}
601  try {iEvent.getByLabel(dedx3Label_, dEdx3Handle);} catch ( cms::Exception& ) {;}
602  const ValueMap<DeDxData> dEdxTrack1 = *dEdx1Handle.product();
603  const ValueMap<DeDxData> dEdxTrack2 = *dEdx2Handle.product();
604  const ValueMap<DeDxData> dEdxTrack3 = *dEdx3Handle.product();
605 
606  // load track collections
607  std::vector<reco::TrackCollection> trackCollection;
608  std::vector<edm::Handle<reco::TrackCollection> > trackCollectionHandle;
609  trackCollectionHandle.resize(trackLabel_.size());
610  size_t index = 0;
611  for(std::vector<edm::InputTag>::const_iterator label = trackLabel_.begin();label!=trackLabel_.end();++label,++index) {
612  try {iEvent.getByLabel(*label,trackCollectionHandle[index]);} catch ( cms::Exception& ) {;}
613  trackCollection.push_back(*trackCollectionHandle[index].product());
614  ntracks_[index] = trackCollection[index].size();
615  }
616 
617  // load the trajectory collections
618  std::vector<std::vector<Trajectory> > trajectoryCollection;
619  std::vector<edm::Handle<std::vector<Trajectory> > > trajectoryCollectionHandle;
620  trajectoryCollectionHandle.resize(trackLabel_.size());
621  index = 0;
622  for(std::vector<edm::InputTag>::const_iterator label = trackLabel_.begin();label!=trackLabel_.end();++label,++index) {
623  try {iEvent.getByLabel(*label,trajectoryCollectionHandle[index]);} catch ( cms::Exception& ) {;}
624  trajectoryCollection.push_back(*trajectoryCollectionHandle[index].product());
625  ntrajs_[index] = trajectoryCollection[index].size();
626  }
627 
628  // load the tracks/traj association maps
629  std::vector<TrajTrackAssociationCollection> TrajToTrackMap;
630  Handle<TrajTrackAssociationCollection> trajTrackAssociationHandle;
631  for(std::vector<edm::InputTag>::const_iterator label = trackLabel_.begin();label!=trackLabel_.end();++label) {
632  try {iEvent.getByLabel(*label,trajTrackAssociationHandle);} catch ( cms::Exception& ) {;}
633  TrajToTrackMap.push_back(*trajTrackAssociationHandle.product());
634  }
635 
636  // sanity check
637  if(!(trackCollection.size()>0 && trajectoryCollection.size()>0)) return;
638 
639  // build the reverse map tracks -> vertex
640  std::vector<std::map<size_t,int> > trackVertices;
641  for(size_t i=0;i<trackLabel_.size();++i) {
642  trackVertices.push_back(inVertex(trackCollection[0], vertexColl, globalvertexid_+1));
643  }
644 
645  // iterate over vertices
647  for(reco::VertexCollection::const_iterator v=vertexColl.begin();
648  v!=vertexColl.end(); ++v) {
649  nTracks_pvtx_ = v->tracksSize();
651  isValid_pvtx_ = int(v->isValid());
652  isFake_pvtx_ = int(v->isFake());
653  recx_pvtx_ = v->x();
654  recy_pvtx_ = v->y();
655  recz_pvtx_ = v->z();
656  recx_err_pvtx_ = v->xError();
657  recy_err_pvtx_ = v->yError();
658  recz_err_pvtx_ = v->zError();
659  globalvertexid_++;
660  vertices_->Fill();
661  }
662  }
663 
664  // iterate over pixel vertices
666  for(reco::VertexCollection::const_iterator v=pixelVertexColl.begin();
667  v!=pixelVertexColl.end(); ++v) {
668  nTracks_pvtx_ = v->tracksSize();
670  isValid_pvtx_ = int(v->isValid());
671  isFake_pvtx_ = int(v->isFake());
672  recx_pvtx_ = v->x();
673  recy_pvtx_ = v->y();
674  recz_pvtx_ = v->z();
675  recx_err_pvtx_ = v->xError();
676  recy_err_pvtx_ = v->yError();
677  recz_err_pvtx_ = v->zError();
678  pixelVertices_->Fill();
679  }
680  }
681 
682  // determine if each cluster is on a track or not, and record the local angle
683  // to do this, we use the first track/traj collection
684  std::vector<double> clusterOntrackAngles = onTrackAngles(clusters,trajectoryCollection[0]);
685  std::vector<std::pair<double,double> > pixclusterOntrackAngles = onTrackAngles(pixelclusters,trajectoryCollection[0]);
686 
687 /*
688  // iterate over trajectories
689  // note: when iterating over trajectories, it might be simpler to use the tracks/trajectories association map
690  for(std::vector<Trajectory>::const_iterator traj = trajVec.begin(); traj< trajVec.end(); ++traj) {
691  }
692  // loop over all rechits from trajectories
693  //iterate over trajectories
694  for(std::vector<Trajectory>::const_iterator traj = trajVec.begin(); traj< trajVec.end(); ++traj) {
695  Trajectory::DataContainer measurements = traj->measurements();
696  // iterate over measurements
697  for(Trajectory::DataContainer::iterator meas = measurements.begin(); meas!= measurements.end(); ++meas) {
698  }
699  }
700 */
701 
702  // determine if each cluster is on a track or not, and record the trackid
703  std::vector< std::vector<int> > stripClusterOntrackIndices;
704  for(size_t i = 0; i<trackLabel_.size(); ++i) {
705  stripClusterOntrackIndices.push_back(onTrack(clusters,trackCollection[i],globaltrackid_[i]+1));
706  }
707  std::vector< std::vector<int> > pixelClusterOntrackIndices;
708  for(size_t i = 0; i<trackLabel_.size(); ++i) {
709  pixelClusterOntrackIndices.push_back(onTrack(pixelclusters,trackCollection[i],globaltrackid_[i]+1));
710  }
711  nclustersOntrack_ = count_if(stripClusterOntrackIndices[0].begin(),stripClusterOntrackIndices[0].end(),bind2nd(not_equal_to<int>(), -1));
712  npixClustersOntrack_ = count_if(pixelClusterOntrackIndices[0].begin(),pixelClusterOntrackIndices[0].end(),bind2nd(not_equal_to<int>(), -1));
713 
714  // iterate over tracks
715  for (size_t coll = 0; coll<trackCollection.size(); ++coll) {
716  uint32_t n_hits_barrel=0;
717  uint32_t n_hits_lowprob=0;
718  for(TrajTrackAssociationCollection::const_iterator it = TrajToTrackMap[coll].begin(); it!=TrajToTrackMap[coll].end(); ++it) {
719  reco::TrackRef itTrack = it->val;
720  edm::Ref<std::vector<Trajectory> > traj = it->key; // bug to find type of the key
721  eta_ = itTrack->eta();
722  phi_ = itTrack->phi();
723  try { // not all track collections have the dedx info... indeed at best one.
724  dedxNoM_ = dEdxTrack1[itTrack].numberOfMeasurements();
725  dedx1_ = dEdxTrack1[itTrack].dEdx();
726  dedx2_ = dEdxTrack2[itTrack].dEdx();
727  dedx3_ = dEdxTrack3[itTrack].dEdx();
728  } catch ( cms::Exception& ) {
729  dedxNoM_ = 0;
730  dedx1_ = 0.;
731  dedx2_ = 0.;
732  dedx3_ = 0.;
733  }
734  charge_ = itTrack->charge();
735  quality_ = itTrack->qualityMask();
736  foundhits_ = itTrack->found();
737  lostHits_ = itTrack->lost();
738  foundhitsStrips_ = itTrack->hitPattern().numberOfValidStripHits();
739  foundhitsPixels_ = itTrack->hitPattern().numberOfValidPixelHits();
740  losthitsStrips_ = itTrack->hitPattern().numberOfLostStripHits();
741  losthitsPixels_ = itTrack->hitPattern().numberOfLostPixelHits();
742  p_ = itTrack->p();
743  pt_ = itTrack->pt();
744  chi2_ = itTrack->chi2();
745  ndof_ = (uint32_t)itTrack->ndof();
746  dz_ = itTrack->dz();
747  dzerr_ = itTrack->dzError();
748  dzCorr_ = itTrack->dz(beamSpot);
749  dxy_ = itTrack->dxy();
750  dxyerr_ = itTrack->dxyError();
751  dxyCorr_ = itTrack->dxy(beamSpot);
752  pterr_ = itTrack->ptError();
753  etaerr_ = itTrack->etaError();
754  phierr_ = itTrack->phiError();
755  qoverp_ = itTrack->qoverp();
756  xPCA_ = itTrack->vertex().x();
757  yPCA_ = itTrack->vertex().y();
758  zPCA_ = itTrack->vertex().z();
759  nLayers_ = uint32_t(itTrack->hitPattern().trackerLayersWithMeasurement());
760  try { // only one track collection (at best) is connected to the main vertex
761  if(vertexColl.size()>0 && !vertexColl.begin()->isFake()) {
762  trkWeightpvtx_ = vertexColl.begin()->trackWeight(itTrack);
763  } else
764  trkWeightpvtx_ = 0.;
765  } catch ( cms::Exception& ) {
766  trkWeightpvtx_ = 0.;
767  }
768  globaltrackid_[coll]++;
769  std::map<size_t,int>::const_iterator theV = trackVertices[coll].find(itTrack.key());
770  vertexid_ = (theV!=trackVertices[coll].end()) ? theV->second : 0;
771  // add missing hits (separate tree, common strip + pixel)
772  Trajectory::DataContainer const & measurements = traj->measurements();
774  for(Trajectory::DataContainer::const_iterator it = measurements.begin(); it!=measurements.end(); ++it) {
775  TrajectoryMeasurement::ConstRecHitPointer rechit = it->recHit();
776  if(!rechit->isValid()) {
777  // detid
778  detid_ = rechit->geographicalId();
779  // status
780  type_ = rechit->getType();
781  // position
782  LocalPoint local = it->predictedState().localPosition();
783  clPositionX_ = local.x();
784  clPositionY_ = local.y();
785  // global position
786  GlobalPoint global = it->predictedState().globalPosition();
787  globalX_ = global.x();
788  globalY_ = global.y();
789  globalZ_ = global.z();
790  // position in the measurement frame
791  measX_ = 0;
792  measY_ = 0;
794  const GeomDetUnit* gdu = static_cast<const GeomDetUnit*>(tracker_->idToDetUnit(detid_));
795  if(gdu && gdu->type().isTracker()) {
796  const Topology& topo = gdu->topology();
797  MeasurementPoint meas = topo.measurementPosition(local);
798  measX_ = meas.x();
799  measY_ = meas.y();
800  }
801  }
802  // local error
803  LocalError error = it->predictedState().localError().positionError();
804  errorX_ = error.xx();
805  errorY_ = error.yy();
806  // fill
807  missingHits_[coll]->Fill();
808  }
809  }
810  }
811  // compute the fraction of low probability pixels... will be added to the event tree
812  for(trackingRecHit_iterator it = itTrack->recHitsBegin(); it!=itTrack->recHitsEnd(); ++it) {
813  const TrackingRecHit* hit = &(**it);
814  const SiPixelRecHit* pixhit = dynamic_cast<const SiPixelRecHit*>(hit);
815  if(pixhit) {
816  DetId detId = pixhit->geographicalId();
818  ++n_hits_barrel;
819  double proba = pixhit->clusterProbability(0);
820  if(proba<=0.0) ++n_hits_lowprob;
821  }
822  }
823  }
824  // fill the track tree
825  if(functionality_tracks_) tracks_[coll]->Fill();
826  }
827  lowPixelProbabilityFraction_[coll] = n_hits_barrel>0 ? (float)n_hits_lowprob/n_hits_barrel : -1.;
828  }
829 
830  // iterate over clusters
831  nclusters_ = 0;
832  std::vector<double>::const_iterator angleIt = clusterOntrackAngles.begin();
833  uint32_t localCounter = 0;
834  for (edmNew::DetSetVector<SiStripCluster>::const_iterator DSViter=clusters->begin(); DSViter!=clusters->end();DSViter++ ) {
837  uint32_t detid = DSViter->id();
838  nclusters_ += DSViter->size();
840  for(edmNew::DetSet<SiStripCluster>::const_iterator iter=begin;iter!=end;++iter,++angleIt,++localCounter) {
841  SiStripClusterInfo* siStripClusterInfo = new SiStripClusterInfo(*iter,iSetup,detid,std::string("")); //string = quality label
842  // general quantities
843  for(size_t i=0; i< trackLabel_.size(); ++i) {
844  trackid_[i] = stripClusterOntrackIndices[i][localCounter];
845  }
846  onTrack_ = (trackid_[0] != (uint32_t)-1);
847  clWidth_ = siStripClusterInfo->width();
848  clPosition_ = siStripClusterInfo->baryStrip();
849  angle_ = *angleIt;
850  thickness_ = ((((DSViter->id()>>25)&0x7f)==0xd) ||
851  ((((DSViter->id()>>25)&0x7f)==0xe) && (((DSViter->id()>>5)&0x7)>4))) ? 500 : 300;
852  stripLength_ = static_cast<const StripGeomDetUnit*>(tracker_->idToDet(detid))->specificTopology().stripLength();
853  int nstrips = static_cast<const StripGeomDetUnit*>(tracker_->idToDet(detid))->specificTopology().nstrips();
854  maxCharge_ = siStripClusterInfo->maxCharge();
855  // signal and noise with gain corrections
856  clNormalizedCharge_ = siStripClusterInfo->charge() ;
857  clNormalizedNoise_ = siStripClusterInfo->noiseRescaledByGain() ;
858  clSignalOverNoise_ = siStripClusterInfo->signalOverNoise() ;
859  // signal and noise with gain corrections and angle corrections
860  clCorrectedCharge_ = clNormalizedCharge_ * fabs(cos(angle_)); // corrected for track angle
861  clCorrectedSignalOverNoise_ = clSignalOverNoise_ * fabs(cos(angle_)); // corrected for track angle
862  // signal and noise without gain corrections
863  clBareNoise_ = siStripClusterInfo->noise();
865  // global position
866  const StripGeomDetUnit* sgdu = static_cast<const StripGeomDetUnit*>(tracker_->idToDet(detid));
868  globalX_ = gp.x();
869  globalY_ = gp.y();
870  globalZ_ = gp.z();
871  // cabling
872  detid_ = detid;
873  lldChannel_ = 1+(int(floor(iter->barycenter()))/256);
874  if(lldChannel_==2 && nstrips==512) lldChannel_=3;
876  delete siStripClusterInfo;
877  }
878  }
879  }
880 
881  // iterate over pixel clusters
882  npixClusters_ = 0;
883  std::vector<std::pair<double,double> >::const_iterator pixAngleIt = pixclusterOntrackAngles.begin();
884  localCounter = 0;
885  for (edmNew::DetSetVector<SiPixelCluster>::const_iterator DSViter=pixelclusters->begin(); DSViter!=pixelclusters->end();DSViter++ ) {
888  uint32_t detid = DSViter->id();
889  npixClusters_ += DSViter->size();
891  for(edmNew::DetSet<SiPixelCluster>::const_iterator iter=begin;iter!=end;++iter,++pixAngleIt,++localCounter) {
892  // general quantities
893  for(size_t i=0; i< trackLabel_.size(); ++i) {
894  trackid_[i] = pixelClusterOntrackIndices[i][localCounter];
895  }
896  onTrack_ = (trackid_[0] != (uint32_t)-1);
897  clPositionX_ = iter->x();
898  clPositionY_ = iter->y();
899  clSize_ = iter->size();
900  clSizeX_ = iter->sizeX();
901  clSizeY_ = iter->sizeY();
902  alpha_ = pixAngleIt->first;
903  beta_ = pixAngleIt->second;
904  charge_ = (iter->charge())/1000.;
905  chargeCorr_ = charge_ * sqrt( 1.0 / ( 1.0/pow( tan(alpha_), 2 ) + 1.0/pow( tan(beta_), 2 ) + 1.0 ))/1000.;
906  // global position
907  const PixelGeomDetUnit* pgdu = static_cast<const PixelGeomDetUnit*>(tracker_->idToDet(detid));
909  globalX_ = gp.x();
910  globalY_ = gp.y();
911  globalZ_ = gp.z();
912  // cabling
913  detid_ = detid;
914  // fill
915  pixclusters_->Fill();
916  }
917  }
918  }
919 
920  // topological quantities - uses the first track collection
921  EventShape shape(trackCollection[0]);
922  math::XYZTLorentzVectorF thrust = shape.thrust();
923  thrustValue_ = thrust.t();
924  thrustX_ = thrust.x();
925  thrustY_ = thrust.y();
926  thrustZ_ = thrust.z();
927  sphericity_ = shape.sphericity();
928  planarity_ = shape.planarity();
929  aplanarity_ = shape.aplanarity();
930 
931  // fill event tree
932  if(functionality_events_) event_->Fill();
933 
934 }
935 
936 // ------------ method called once each job just before starting event loop ------------
937 void
939 {
940 
941  //Retrieve tracker topology from geometry
942  edm::ESHandle<TrackerTopology> tTopoHandle;
943  iSetup.get<IdealGeometryRecord>().get(tTopoHandle);
944  const TrackerTopology* const tTopo = tTopoHandle.product();
945 
946  //geometry
947  iSetup.get<TrackerDigiGeometryRecord>().get(tracker_);
948 
949  //HLT names
950  bool changed (true);
951  if (hltConfig_.init(iRun,iSetup,HLTLabel_.process(),changed)) {
952  if (changed) {
954  }
955  }
956  int i=0;
957  for(std::vector<std::string>::const_iterator it = hlNames_.begin(); it<hlNames_.end();++it) {
958  std::cout << (i++) << " = " << (*it) << std::endl;
959  }
960 
961  // read the delay offsets for each device from input files
962  // this is only for the so-called "random delay" run
963  std::map<uint32_t,float> delayMap = delay(delayFileNames_);
964  TrackerMap tmap("Delays");
965 
966  // cabling I (readout)
967  iSetup.get<SiStripFedCablingRcd>().get( cabling_ );
968  auto feds = cabling_->fedIds() ;
969  for(auto fedid = feds.begin();fedid<feds.end();++fedid) {
970  auto connections = cabling_->fedConnections(*fedid);
971  for(auto conn=connections.begin();conn<connections.end();++conn) {
972  // Fill the "old" map to be used for lookup during analysis
973  if(conn->isConnected())
974  connections_.insert(std::make_pair(conn->detId(),new FedChannelConnection(*conn)));
975  // Fill the standalone tree (once for all)
976  if(conn->isConnected()) {
977  detid_ = conn->detId();
978  strncpy(moduleName_,toStringName(detid_,tTopo).c_str(),256);
979  strncpy(moduleId_,toStringId(detid_).c_str(),256);
980  lldChannel_ = conn->lldChannel();
981  dcuId_ = conn->dcuId();
982  fecCrate_ = conn->fecCrate();
983  fecSlot_ = conn->fecSlot();
984  fecRing_ = conn->fecRing();
985  ccuAdd_ = conn->ccuAddr();
986  ccuChan_ = conn->ccuChan();
987  fedId_ = conn->fedId();
988  fedCh_ = conn->fedCh();
989  fiberLength_ = conn->fiberLength();
990  delay_ = delayMap[dcuId_];
991  const StripGeomDetUnit* sgdu = static_cast<const StripGeomDetUnit*>(tracker_->idToDet(detid_));
992  Surface::GlobalPoint gp = sgdu->surface().toGlobal(LocalPoint(0,0));
993  globalX_ = gp.x();
994  globalY_ = gp.y();
995  globalZ_ = gp.z();
996  readoutmap_->Fill();
998  }
999  }
1000  }
1001  if(delayMap.size()) tmap.save(true, 0, 0, "delaymap.png");
1002 
1003  // cabling II (DCU map)
1004  std::ifstream cablingFile(cablingFileName_.c_str());
1005  if(cablingFile.is_open()) {
1006  char buffer[1024];
1007  cablingFile.getline(buffer,1024);
1008  while(!cablingFile.eof()) {
1009  std::istringstream line(buffer);
1010  std::string name;
1011  // one line contains the PSU name + all dcuids connected to it.
1012  line >> name;
1013  strncpy(PSUname_,name.c_str(),256);
1014  while(!line.eof()) {
1015  line >> dcuId_;
1016  psumap_->Fill();
1017  }
1018  cablingFile.getline(buffer,1024);
1019  }
1020  } else {
1021  edm::LogWarning("BadConfig") << " The PSU file does not exist. The psumap tree will not be filled."
1022  << std::endl << " Looking for " << cablingFileName_.c_str() << "."
1023  << std::endl << " Please specify a valid filename through the PSUFileName untracked parameter.";
1024  }
1025 }
1026 
1027 // ------------ method called once each job just after ending the event loop ------------
1028 void
1030  for(size_t i = 0; i<tracks_.size();++i) {
1031  char buffer[256];
1032  sprintf(buffer,"trackid%lu",(unsigned long)i);
1033  if(tracks_[i]->GetEntries()) tracks_[i]->BuildIndex(buffer,"eventid");
1034  }
1035  /* not needed: missing hits is a high-level quantity
1036  for(size_t i = 0; i<missingHits_.size();++i) {
1037  char buffer[256];
1038  sprintf(buffer,"trackid%lu",(unsigned long)i);
1039  if(missingHits_[i]->GetEntries()) missingHits_[i]->BuildIndex(buffer);
1040  }
1041  */
1042  if(vertices_->GetEntries()) vertices_->BuildIndex("vertexid","eventid");
1043  if(event_->GetEntries()) event_->BuildIndex("runid","eventid");
1044  if(psumap_->GetEntries()) psumap_->BuildIndex("dcuId");
1045  if(readoutmap_->GetEntries()) readoutmap_->BuildIndex("detid","lldChannel");
1046 }
1047 
1049  const std::vector<Trajectory>& trajVec )
1050 {
1051  std::vector<double> result;
1052  // first, build a list of positions and angles on trajectories
1053  std::multimap<const uint32_t,std::pair<LocalPoint,double> > onTrackPositions;
1054  for(std::vector<Trajectory>::const_iterator traj = trajVec.begin(); traj< trajVec.end(); ++traj) {
1055  Trajectory::DataContainer measurements = traj->measurements();
1056  for(Trajectory::DataContainer::iterator meas = measurements.begin(); meas!= measurements.end(); ++meas) {
1057  double tla = meas->updatedState().localDirection().theta();
1058  insertMeasurement(onTrackPositions,&(*(meas->recHit())),tla);
1059  }
1060  }
1061  // then loop over the clusters to check
1062  double angle = 0.;
1063  for (edmNew::DetSetVector<SiStripCluster>::const_iterator DSViter=clusters->begin(); DSViter!=clusters->end();DSViter++ ) {
1066  std::pair< std::multimap<uint32_t,std::pair<LocalPoint,double> >::const_iterator,
1067  std::multimap<uint32_t,std::pair<LocalPoint,double> >::const_iterator> range =
1068  onTrackPositions.equal_range(DSViter->id());
1069  const GeomDetUnit* gdu = static_cast<const GeomDetUnit*>(tracker_->idToDet(DSViter->id()));
1070  for(edmNew::DetSet<SiStripCluster>::const_iterator iter=begin;iter!=end;++iter) {
1071  angle = 0.;
1072  for(std::multimap<uint32_t,std::pair<LocalPoint,double> >::const_iterator cl = range.first; cl!= range.second; ++cl) {
1073  if(fabs(gdu->topology().measurementPosition(cl->second.first).x()-iter->barycenter())<2) {
1074  angle = cl->second.second;
1075  }
1076  }
1077  result.push_back(angle);
1078  }
1079  }
1080  return result;
1081 }
1082 
1083 void TrackerDpgAnalysis::insertMeasurement(std::multimap<const uint32_t,std::pair<LocalPoint,double> >& collection,const TransientTrackingRecHit* hit , double tla)
1084 {
1085  if(!hit) return;
1086  const TSiTrackerMultiRecHit* multihit=dynamic_cast<const TSiTrackerMultiRecHit*>(hit);
1087  const TSiStripRecHit2DLocalPos* singlehit=dynamic_cast<const TSiStripRecHit2DLocalPos*>(hit);
1088  const TSiStripRecHit1D* hit1d=dynamic_cast<const TSiStripRecHit1D*>(hit);
1089  if(hit1d) { //...->33X
1090  collection.insert(std::make_pair(hit1d->geographicalId().rawId(),std::make_pair(hit1d->localPosition(),tla)));
1091  } else if(singlehit) { // 41X->...
1092  collection.insert(std::make_pair(singlehit->geographicalId().rawId(),std::make_pair(singlehit->localPosition(),tla)));
1093  }
1094  else if(multihit){
1095  std::vector< const TrackingRecHit * > childs = multihit->recHits();
1096  for(std::vector<const TrackingRecHit*>::const_iterator it=childs.begin();it!=childs.end();++it) {
1097  insertMeasurement(collection,dynamic_cast<const TransientTrackingRecHit*>(*it),tla);
1098  }
1099  }
1100 }
1101 
1103  const reco::TrackCollection& trackVec, uint32_t firstTrack )
1104 {
1105  std::vector<int> result;
1106  // first, build a list of positions and trackid on tracks
1107  std::multimap<const uint32_t,std::pair<int,int> > onTrackPositions;
1108  uint32_t trackid = firstTrack;
1109  for(reco::TrackCollection::const_iterator itTrack = trackVec.begin(); itTrack!=trackVec.end();++itTrack,++trackid) {
1110  for(trackingRecHit_iterator it = itTrack->recHitsBegin(); it!=itTrack->recHitsEnd(); ++it) {
1111  const TrackingRecHit* hit = &(**it);
1112  insertMeasurement(onTrackPositions,hit,trackid);
1113  }
1114  }
1115  // then loop over the clusters to check
1116  int thetrackid = -1;
1117  for (edmNew::DetSetVector<SiStripCluster>::const_iterator DSViter=clusters->begin(); DSViter!=clusters->end();DSViter++ ) {
1120  std::pair< std::multimap<uint32_t,std::pair<int,int> >::const_iterator,
1121  std::multimap<uint32_t,std::pair<int,int> >::const_iterator> range =
1122  onTrackPositions.equal_range(DSViter->id());
1123  for(edmNew::DetSet<SiStripCluster>::const_iterator iter=begin;iter!=end;++iter) {
1124  thetrackid = -1;
1125  for(std::multimap<uint32_t,std::pair<int,int> >::const_iterator cl = range.first; cl!= range.second; ++cl) {
1126  if(fabs(cl->second.first-iter->barycenter())<2) {
1127  thetrackid = cl->second.second;
1128  }
1129  }
1130  result.push_back(thetrackid);
1131  }
1132  }
1133  return result;
1134 }
1135 
1136 void TrackerDpgAnalysis::insertMeasurement(std::multimap<const uint32_t,std::pair<int, int> >& collection,const TrackingRecHit* hit , int trackid)
1137 {
1138  if(!hit) return;
1139  const SiTrackerMultiRecHit* multihit=dynamic_cast<const SiTrackerMultiRecHit*>(hit);
1140  const SiStripRecHit2D* singlehit=dynamic_cast<const SiStripRecHit2D*>(hit);
1141  const SiStripRecHit1D* hit1d=dynamic_cast<const SiStripRecHit1D*>(hit);
1142  if(hit1d) { // 41X->...
1143  collection.insert(std::make_pair(hit1d->geographicalId().rawId(),std::make_pair(int(hit1d->cluster()->barycenter()),trackid)));
1144  } else if(singlehit) { //...->33X
1145  collection.insert(std::make_pair(singlehit->geographicalId().rawId(),std::make_pair(int(singlehit->cluster()->barycenter()),trackid)));
1146  }
1147  else if(multihit){
1148  std::vector< const TrackingRecHit * > childs = multihit->recHits();
1149  for(std::vector<const TrackingRecHit*>::const_iterator it=childs.begin();it!=childs.end();++it) {
1150  insertMeasurement(collection,*it,trackid);
1151  }
1152  }
1153 }
1154 
1155 std::map<size_t,int> TrackerDpgAnalysis::inVertex(const reco::TrackCollection& tracks, const reco::VertexCollection& vertices, uint32_t firstVertex)
1156 {
1157  // build reverse map track -> vertex
1158  std::map<size_t,int> output;
1159  uint32_t vertexid = firstVertex;
1160  for(reco::VertexCollection::const_iterator v = vertices.begin(); v!=vertices.end(); ++v,++vertexid) {
1161  reco::Vertex::trackRef_iterator it = v->tracks_begin();
1162  reco::Vertex::trackRef_iterator lastTrack = v->tracks_end();
1163  for(;it!=lastTrack;++it) {
1164  output[it->key()] = vertexid;
1165  }
1166  }
1167  return output;
1168 }
1169 
1171  const std::vector<Trajectory>& trajVec )
1172 {
1173  std::vector<std::pair<double,double> > result;
1174  // first, build a list of positions and angles on trajectories
1175  std::multimap<const uint32_t,std::pair<LocalPoint,std::pair<double,double> > > onTrackPositions;
1176  for(std::vector<Trajectory>::const_iterator traj = trajVec.begin(); traj< trajVec.end(); ++traj) {
1177  Trajectory::DataContainer measurements = traj->measurements();
1178  for(Trajectory::DataContainer::iterator meas = measurements.begin(); meas!= measurements.end(); ++meas) {
1179  LocalVector localDir = meas->updatedState().localDirection();
1180  double alpha = atan2(localDir.z(), localDir.x());
1181  double beta = atan2(localDir.z(), localDir.y());
1182  insertMeasurement(onTrackPositions,&(*(meas->recHit())),alpha,beta);
1183  }
1184  }
1185  // then loop over the clusters to check
1186  double alpha = 0.;
1187  double beta = 0.;
1188  for (edmNew::DetSetVector<SiPixelCluster>::const_iterator DSViter=clusters->begin(); DSViter!=clusters->end();DSViter++ ) {
1191  for(edmNew::DetSet<SiPixelCluster>::const_iterator iter=begin;iter!=end;++iter) {
1192  alpha = 0.;
1193  beta = 0.;
1194  std::pair< std::multimap<uint32_t,std::pair<LocalPoint,std::pair<double, double> > >::const_iterator,
1195  std::multimap<uint32_t,std::pair<LocalPoint,std::pair<double, double> > >::const_iterator> range =
1196  onTrackPositions.equal_range(DSViter->id());
1197  const GeomDetUnit* gdu = static_cast<const GeomDetUnit*>(tracker_->idToDet(DSViter->id()));
1198  for(std::multimap<uint32_t,std::pair<LocalPoint,std::pair<double, double> > >::const_iterator cl = range.first; cl!= range.second; ++cl) {
1199  if(fabs(gdu->topology().measurementPosition(cl->second.first).x()-iter->x())<2 &&
1200  fabs(gdu->topology().measurementPosition(cl->second.first).y()-iter->y())<2 ) {
1201  alpha = cl->second.second.first;
1202  beta = cl->second.second.second;
1203  }
1204  }
1205  result.push_back(std::make_pair(alpha,beta));
1206  }
1207  }
1208  return result;
1209 }
1210 
1211 void TrackerDpgAnalysis::insertMeasurement(std::multimap<const uint32_t,std::pair<LocalPoint,std::pair<double,double> > >& collection,const TransientTrackingRecHit* hit , double alpha, double beta)
1212 {
1213  if(!hit) return;
1214  const TSiPixelRecHit* pixhit = dynamic_cast<const TSiPixelRecHit*>(hit);
1215  if(pixhit) {
1216  collection.insert(std::make_pair(pixhit->geographicalId().rawId(),std::make_pair(pixhit->localPosition(),std::make_pair(alpha,beta))));
1217  }
1218 }
1219 
1221  const reco::TrackCollection& trackVec, uint32_t firstTrack )
1222 {
1223  std::vector<int> result;
1224  // first, build a list of positions and trackid on tracks
1225  std::multimap<const uint32_t,std::pair<std::pair<float, float>,int> > onTrackPositions;
1226  uint32_t trackid = firstTrack;
1227  for(reco::TrackCollection::const_iterator itTrack = trackVec.begin(); itTrack!=trackVec.end();++itTrack,++trackid) {
1228  for(trackingRecHit_iterator it = itTrack->recHitsBegin(); it!=itTrack->recHitsEnd(); ++it) {
1229  const TrackingRecHit* hit = &(**it);
1230  insertMeasurement(onTrackPositions,hit,trackid);
1231  }
1232  }
1233  // then loop over the clusters to check
1234  int thetrackid = -1;
1235  for (edmNew::DetSetVector<SiPixelCluster>::const_iterator DSViter=clusters->begin(); DSViter!=clusters->end();DSViter++ ) {
1238  for(edmNew::DetSet<SiPixelCluster>::const_iterator iter=begin;iter!=end;++iter) {
1239  thetrackid = -1;
1240  std::pair< std::multimap<uint32_t,std::pair<std::pair<float, float>,int> >::const_iterator,
1241  std::multimap<uint32_t,std::pair<std::pair<float, float>,int> >::const_iterator> range =
1242  onTrackPositions.equal_range(DSViter->id());
1243  for(std::multimap<uint32_t,std::pair<std::pair<float, float>,int> >::const_iterator cl = range.first; cl!= range.second; ++cl) {
1244  if((fabs(cl->second.first.first-iter->x())<2)&&(fabs(cl->second.first.second-iter->y())<2)) {
1245  thetrackid = cl->second.second;
1246  }
1247  }
1248  result.push_back(thetrackid);
1249  }
1250  }
1251  return result;
1252 }
1253 
1254 void TrackerDpgAnalysis::insertMeasurement(std::multimap<const uint32_t,std::pair<std::pair<float, float>, int> >& collection,const TrackingRecHit* hit , int trackid)
1255 {
1256  if(!hit) return;
1257  const SiPixelRecHit* pixhit = dynamic_cast<const SiPixelRecHit*>(hit);
1258  if(pixhit) {
1259  collection.insert(std::make_pair(pixhit->geographicalId().rawId(),std::make_pair(std::make_pair(pixhit->cluster()->x(),pixhit->cluster()->y()),trackid)));
1260  }
1261 }
1262 
1264  SiStripDetId detid(rawid);
1265  std::string out;
1266  std::stringstream output;
1267  switch(detid.subDetector()) {
1268  case 3:
1269  {
1270  output << "TIB";
1271 
1272  output << (tTopo->tibIsZPlusSide(rawid) ? "+" : "-");
1273  output << " layer ";
1274  output << tTopo->tibLayer(rawid);
1275  output << ", string ";
1276  output << tTopo->tibString(rawid);
1277  output << (tTopo->tibIsExternalString(rawid) ? " external" : " internal");
1278  output << ", module ";
1279  output << tTopo->tibModule(rawid);
1280  if(tTopo->tibIsDoubleSide(rawid)) {
1281  output << " (double)";
1282  } else {
1283  output << (tTopo->tibIsRPhi(rawid) ? " (rphi)" : " (stereo)");
1284  }
1285  break;
1286  }
1287  case 4:
1288  {
1289  output << "TID";
1290 
1291  output << (tTopo->tidIsZPlusSide(rawid) ? "+" : "-");
1292  output << " disk ";
1293  output << tTopo->tidWheel(rawid);
1294  output << ", ring ";
1295  output << tTopo->tidRing(rawid);
1296  output << (tTopo->tidIsFrontRing(rawid) ? " front" : " back");
1297  output << ", module ";
1298  output << tTopo->tidModule(rawid);
1299  if(tTopo->tidIsDoubleSide(rawid)) {
1300  output << " (double)";
1301  } else {
1302  output << (tTopo->tidIsRPhi(rawid) ? " (rphi)" : " (stereo)");
1303  }
1304  break;
1305  }
1306  case 5:
1307  {
1308  output << "TOB";
1309 
1310  output << (tTopo->tobIsZPlusSide(rawid) ? "+" : "-");
1311  output << " layer ";
1312  output << tTopo->tobLayer(rawid);
1313  output << ", rod ";
1314  output << tTopo->tobRod(rawid);
1315  output << ", module ";
1316  output << tTopo->tobModule(rawid);
1317  if(tTopo->tobIsDoubleSide(rawid)) {
1318  output << " (double)";
1319  } else {
1320  output << (tTopo->tobIsRPhi(rawid) ? " (rphi)" : " (stereo)");
1321  }
1322  break;
1323  }
1324  case 6:
1325  {
1326  output << "TEC";
1327 
1328  output << (tTopo->tecIsZPlusSide(rawid) ? "+" : "-");
1329  output << " disk ";
1330  output << tTopo->tecWheel(rawid);
1331  output << " sector ";
1332  output << tTopo->tecPetalNumber(rawid);
1333  output << (tTopo->tecIsFrontPetal(rawid) ? " Front Petal" : " Back Petal");
1334  output << ", module ";
1335  output << tTopo->tecRing(rawid);
1336  output << tTopo->tecModule(rawid);
1337  if(tTopo->tecIsDoubleSide(rawid)) {
1338  output << " (double)";
1339  } else {
1340  output << (tTopo->tecIsRPhi(rawid) ? " (rphi)" : " (stereo)");
1341  }
1342  break;
1343  }
1344  default:
1345  {
1346  output << "UNKNOWN";
1347  }
1348  }
1349  out = output.str();
1350  return out;
1351 }
1352 
1354  std::string out;
1355  std::stringstream output;
1356  output << rawid << " (0x" << std::hex << rawid << std::dec << ")";
1357  out = output.str();
1358  return out;
1359 }
1360 
1362  double sum = 0.;
1363  double pT;
1364  for (reco::Vertex::trackRef_iterator it = v.tracks_begin(); it != v.tracks_end(); it++) {
1365  pT = (**it).pt();
1366  sum += pT*pT;
1367  }
1368  return sum;
1369 }
1370 
1372  float delay = const_cast<SiStripEventSummary&>(summary).ttcrx();
1373  uint32_t latencyCode = (const_cast<SiStripEventSummary&>(summary).layerScanned()>>24)&0xff;
1374  int latencyShift = latencyCode & 0x3f; // number of bunch crossings between current value and start of scan... must be positive
1375  if(latencyShift>32) latencyShift -=64; // allow negative values: we cover [-32,32].. should not be needed.
1376  if((latencyCode>>6)==2) latencyShift -= 3; // layer in deconv, rest in peak
1377  if((latencyCode>>6)==1) latencyShift += 3; // layer in peak, rest in deconv
1378  float correctedDelay = delay - (latencyShift*25.); // shifts the delay so that 0 corresponds to the current settings.
1379  return correctedDelay;
1380 }
1381 
1382 std::map<uint32_t,float> TrackerDpgAnalysis::delay(const std::vector<std::string>& files) {
1383  // prepare output
1384  uint32_t dcuid;
1385  float delay;
1386  std::map<uint32_t,float> delayMap;
1387  //iterator over input files
1388  for(std::vector<std::string>::const_iterator file=files.begin();file<files.end();++file){
1389  // open the file
1390  std::ifstream cablingFile(file->c_str());
1391  if(cablingFile.is_open()) {
1392  char buffer[1024];
1393  // read one line
1394  cablingFile.getline(buffer,1024);
1395  while(!cablingFile.eof()) {
1396  std::string line(buffer);
1397  size_t pos = line.find("dcuid");
1398  // one line containing dcuid
1399  if(pos != std::string::npos) {
1400  // decode dcuid
1401  std::string dcuids = line.substr(pos+7,line.find(" ",pos)-pos-8);
1402  std::istringstream dcuidstr(dcuids);
1403  dcuidstr >> std::hex >> dcuid;
1404  // decode delay
1405  pos = line.find("difpll");
1406  std::string diffs = line.substr(pos+8,line.find(" ",pos)-pos-9);
1407  std::istringstream diffstr(diffs);
1408  diffstr >> delay;
1409  // fill the map
1410  delayMap[dcuid] = delay;
1411  }
1412  // iterate
1413  cablingFile.getline(buffer,1024);
1414  }
1415  } else {
1416  edm::LogWarning("BadConfig") << " The delay file does not exist. The delay map will not be filled properly."
1417  << std::endl << " Looking for " << file->c_str() << "."
1418  << std::endl << " Please specify valid filenames through the DelayFileNames untracked parameter.";
1419  }
1420  }
1421  return delayMap;
1422 }
1423 
1424 //define this as a plug-in
RunNumber_t run() const
Definition: EventID.h:42
const double beta
uint8_t maxCharge() const
GlobalPoint toGlobal(const Point2DBase< Scalar, LocalTag > lp) const
Definition: Surface.h:114
T getParameter(std::string const &) const
EventNumber_t event() const
Definition: EventID.h:44
T getUntrackedParameter(std::string const &, T const &) const
std::vector< TTree * > tracks_
int i
Definition: DBlmapReader.cc:9
float xx() const
Definition: LocalError.h:24
bool tecIsDoubleSide(const DetId &id) const
std::vector< edm::InputTag > trackLabel_
float alpha
Definition: AMPTWrapper.h:95
boost::transform_iterator< IterHelp, const_IdIter > const_iterator
bool tobIsDoubleSide(const DetId &id) const
virtual void beginRun(const edm::Run &, const edm::EventSetup &) override
edm::InputTag pixelclusterLabel_
T y() const
Definition: PV2DBase.h:46
bool tibIsDoubleSide(const DetId &id) const
unsigned int tibLayer(const DetId &id) const
unsigned int tibString(const DetId &id) const
unsigned int tidRing(const DetId &id) const
edm::ParameterSet pset_
virtual LocalPoint localPosition(const MeasurementPoint &) const =0
trackRef_iterator tracks_end() const
last iterator over tracks
Definition: Vertex.cc:44
std::vector< int > onTrack(edm::Handle< edmNew::DetSetVector< SiStripCluster > > &, const reco::TrackCollection &, uint32_t)
float noise() const
double sumPtSquared(const reco::Vertex &)
static float planarity(const reco::TrackCollection &)
Definition: EventShape.cc:272
float noiseRescaledByGain() const
bool isTracker() const
Definition: GeomDetType.cc:35
#define DEFINE_FWK_MODULE(type)
Definition: MakerMacros.h:17
unsigned int tecRing(const DetId &id) const
ring id
const std::vector< std::string > & triggerNames() const
names of trigger paths
float baryStrip() const
std::vector< Track > TrackCollection
collection of Tracks
Definition: TrackFwd.h:10
Timestamp const & time() const
T y() const
Definition: PV3DBase.h:63
bool tidIsFrontRing(const DetId &id) const
std::vector< Vertex > VertexCollection
collection of Vertex objects
Definition: VertexFwd.h:9
unsigned int tidWheel(const DetId &id) const
data_type const * const_iterator
Definition: DetSetNew.h:30
edm::InputTag pixelVertexLabel_
static math::XYZTLorentzVectorF thrust(const reco::TrackCollection &)
Definition: EventShape.cc:123
std::string toStringId(uint32_t)
virtual void analyze(const edm::Event &, const edm::EventSetup &) override
virtual const StripTopology & specificTopology() const
Returns a reference to the strip proxy topology.
bool tobIsRPhi(const DetId &id) const
std::pair< double, double > Point
Definition: CaloEllipse.h:18
edm::ESHandle< TrackerGeometry > tracker_
const Plane & surface() const
The nominal surface of the GeomDet.
Definition: GeomDet.h:35
int bunchCrossing() const
LuminosityBlockNumber_t luminosityBlock() const
static float sphericity(const reco::TrackCollection &)
Definition: EventShape.cc:212
bool tibIsZPlusSide(const DetId &id) const
virtual const Topology & topology() const =0
std::vector< bool > DecisionWordExtended
float signalOverNoise() const
Measurement2DPoint MeasurementPoint
Measurement points are two-dimensional by default.
int iEvent
Definition: GenABIO.cc:243
bool tibIsExternalString(const DetId &id) const
std::vector< TrajectoryMeasurement > DataContainer
Definition: Trajectory.h:42
virtual std::vector< const TrackingRecHit * > recHits() const
Access to component RecHits (if any)
bool tibIsRPhi(const DetId &id) const
int storeNumber() const
uint16_t charge() const
std::vector< std::string > delayFileNames_
edm::InputTag clusterLabel_
float yy() const
Definition: LocalError.h:26
Class containning control, module, detector and connection information, at the level of a FED channel...
int orbitNumber() const
edm::ESHandle< SiStripFedCabling > cabling_
std::vector< bool > DecisionWord
typedefs
T sqrt(T t)
Definition: SSEVec.h:48
unsigned int tidModule(const DetId &id) const
void save(bool print_total=true, float minval=0., float maxval=0., std::string s="svgmap.svg", int width=1500, int height=800)
Definition: TrackerMap.cc:698
T z() const
Definition: PV3DBase.h:64
static const int nMaxPVs_
tuple result
Definition: query.py:137
bool tobIsZPlusSide(const DetId &id) const
Cos< T >::type cos(const T &t)
Definition: Cos.h:22
math::XYZPoint Point
uint16_t width() const
Tan< T >::type tan(const T &t)
Definition: Tan.h:22
static float aplanarity(const reco::TrackCollection &)
Definition: EventShape.cc:243
std::vector< bool > TechnicalTriggerWord
technical trigger bits (64 bits)
virtual MeasurementPoint measurementPosition(const LocalPoint &) const =0
T * make(const Args &...args) const
make new ROOT object
#define end
Definition: vmac.h:37
virtual void endJob() override
virtual const GeomDetType & type() const =0
std::vector< double > onTrackAngles(edm::Handle< edmNew::DetSetVector< SiStripCluster > > &, const std::vector< Trajectory > &)
int subdetId() const
get the contents of the subdetector field (not cast into any detector&#39;s numbering enum) ...
Definition: DetId.h:37
bool getByLabel(InputTag const &tag, Handle< PROD > &result) const
Definition: Event.h:390
bool tecIsRPhi(const DetId &id) const
HLTConfigProvider hltConfig_
unsigned int tibModule(const DetId &id) const
std::multimap< const uint32_t, const FedChannelConnection * > connections_
tuple out
Definition: dbtoconf.py:99
unsigned int tecModule(const DetId &id) const
bool tecIsFrontPetal(const DetId &id) const
void insertMeasurement(std::multimap< const uint32_t, std::pair< LocalPoint, double > > &, const TransientTrackingRecHit *, double)
Detector identifier class for the strip tracker.
Definition: SiStripDetId.h:17
EventAuxiliary const & eventAuxiliary() const
Definition: Event.h:72
SubDetector subDetector() const
Definition: SiStripDetId.h:114
Definition: DetId.h:18
bool tidIsRPhi(const DetId &id) const
TFileDirectory mkdir(const std::string &dir, const std::string &descr="")
create a new subdirectory
Definition: TFileService.h:69
TrackerDpgAnalysis(const edm::ParameterSet &)
bool tidIsZPlusSide(const DetId &id) const
edm::Service< TFileService > fileService
tuple tracks
Definition: testEve_cfg.py:39
XYZPointD XYZPoint
point in space with cartesian internal representation
Definition: Point3D.h:12
bool init(const edm::Run &iRun, const edm::EventSetup &iSetup, const std::string &processName, bool &changed)
d&#39;tor
const T & get() const
Definition: EventSetup.h:55
bool tidIsDoubleSide(const DetId &id) const
virtual const PixelTopology & specificTopology() const
Returns a reference to the pixel proxy topology.
key_type key() const
Accessor for product key.
Definition: Ref.h:266
T const * product() const
Definition: ESHandle.h:62
const DecisionWord & gtDecisionWord() const
get/set/print algorithms bits (decision word)
Definition: L1GtFdlWord.h:171
std::map< size_t, int > inVertex(const reco::TrackCollection &, const reco::VertexCollection &, uint32_t)
edm::InputTag vertexLabel_
unsigned int tobModule(const DetId &id) const
bool tecIsZPlusSide(const DetId &id) const
std::string const & process() const
Definition: InputTag.h:46
std::string toStringName(uint32_t, const TrackerTopology *)
edm::EventID id() const
Definition: EventBase.h:56
float delay(const SiStripEventSummary &)
#define begin
Definition: vmac.h:30
std::vector< TTree * > missingHits_
std::vector< TrackBaseRef >::const_iterator trackRef_iterator
The iteratator for the vector&lt;TrackRef&gt;
Definition: Vertex.h:37
Local3DPoint LocalPoint
Definition: LocalPoint.h:11
virtual LocalPoint localPosition(float strip) const =0
void fill_current_val(int idmod, float current_val)
Definition: TrackerMap.cc:2749
unsigned int tecPetalNumber(const DetId &id) const
tuple cout
Definition: gather_cfg.py:121
dbl *** dir
Definition: mlp_gen.cc:35
trackRef_iterator tracks_begin() const
first iterator over tracks
Definition: Vertex.cc:39
ROOT::Math::LorentzVector< ROOT::Math::PxPyPzE4D< float > > XYZTLorentzVectorF
Lorentz vector with cylindrical internal representation using pseudorapidity.
Definition: LorentzVector.h:22
unsigned int tobRod(const DetId &id) const
T x() const
Definition: PV2DBase.h:45
T x() const
Definition: PV3DBase.h:62
unsigned int tecWheel(const DetId &id) const
TimeValue_t value() const
Definition: Timestamp.h:56
tuple conn
Definition: results_mgr.py:53
Power< A, B >::type pow(const A &a, const B &b)
Definition: Power.h:40
std::vector< std::string > hlNames_
unsigned int tobLayer(const DetId &id) const
Definition: Run.h:41
Pixel Reconstructed Hit.
T angle(T x1, T y1, T z1, T x2, T y2, T z2)
Definition: angle.h:11