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