CMS 3D CMS Logo

SiStripGainsPCLWorker.h
Go to the documentation of this file.
1 // -*- C++ -*-
2 //
3 // Package: CalibTracker/SiStripChannelGain
4 // Class: SiStripGainsPCLWorker
5 //
10 //
11 // Original Author: L. Quertermont (calibration algorithm)
12 // Contributors: M. Verzetti (data access)
13 // A. Di Mattia (PCL multi stream processing and monitoring)
14 // M. Delcourt (monitoring)
15 // M. Musich (migration to thread-safe DQMStore access)
16 //
17 // Created: Wed, 12 Apr 2017 14:46:48 GMT
18 //
19 
20 // CMSSW includes
65 
68 
69 // System includes
70 #include <unordered_map>
71 
72 //
73 // class declaration
74 //
75 
77 public:
79 
80  static void fillDescriptions(edm::ConfigurationDescriptions& descriptions);
81 
82 private:
83  virtual void beginJob() ;
84  virtual void bookHistograms(DQMStore::IBooker &, edm::Run const &, edm::EventSetup const &);
85  virtual void dqmBeginRun(edm::Run const&, edm::EventSetup const&);
86  virtual void analyze(const edm::Event&, const edm::EventSetup&);
87  virtual void endJob() ;
88 
89  void processEvent(); //what really does the job
90  virtual void checkBookAPVColls(const edm::EventSetup& setup);
91 
92  std::vector<std::string> dqm_tag_;
93 
94  int statCollectionFromMode(const char* tag) const;
95 
96  std::vector<MonitorElement*> Charge_Vs_Index;
97  std::vector<MonitorElement*> Charge_Vs_PathlengthTIB;
98  std::vector<MonitorElement*> Charge_Vs_PathlengthTOB;
99  std::vector<MonitorElement*> Charge_Vs_PathlengthTIDP;
100  std::vector<MonitorElement*> Charge_Vs_PathlengthTIDM;
101  std::vector<MonitorElement*> Charge_Vs_PathlengthTECP1;
102  std::vector<MonitorElement*> Charge_Vs_PathlengthTECP2;
103  std::vector<MonitorElement*> Charge_Vs_PathlengthTECM1;
104  std::vector<MonitorElement*> Charge_Vs_PathlengthTECM2;
105 
106  unsigned int NEvent;
107  unsigned int NTrack;
108  unsigned int NClusterStrip;
109  unsigned int NClusterPixel;
112  unsigned int SRun;
113  unsigned int ERun;
114 
117  double MinTrackEta;
118  double MaxTrackEta;
119  unsigned int MaxNrStrips;
120  unsigned int MinTrackHits;
128 
131 
133  const TrackerGeometry *bareTkGeomPtr_; // ugly hack to fill APV colls only once, but checks
134 
135  //Data members for processing
136 
137  //Event data
138  unsigned int eventnumber =0;
139  unsigned int runnumber =0;
141 
142  // Track data
150 
151  // CalibTree data
153  const std::vector<unsigned int>* rawid =0; edm::EDGetTokenT<std::vector<unsigned int> > rawid_token_;
158  const std::vector<unsigned short>* nstrips =0; edm::EDGetTokenT<std::vector<unsigned short> > nstrips_token_;
162  const std::vector<unsigned int>* charge =0; edm::EDGetTokenT<std::vector<unsigned int> > charge_token_;
163  const std::vector<double>* path =0; edm::EDGetTokenT<std::vector<double> > path_token_;
167 
170  std::string TrackPrefix_; //("track");
172  std::string CalibPrefix_; //("GainCalibration");
174 
175  std::vector<std::shared_ptr<stAPVGain> > APVsCollOrdered;
176  std::unordered_map<unsigned int, std::shared_ptr<stAPVGain> > APVsColl;
177 
178 };
179 
180 inline int
182 {
183  std::vector<std::string>::const_iterator it=dqm_tag_.begin();
184  while(it!=dqm_tag_.end()) {
185  if(*it==std::string(tag)) return it-dqm_tag_.begin();
186  it++;
187  }
188 
189  if (std::string(tag)=="") return 0; // return StdBunch calibration mode for backward compatibility
190 
191  return None;
192 }
193 
194 template<typename T>
195 inline edm::Handle<T> connect(const T* &ptr, edm::EDGetTokenT<T> token, const edm::Event &evt) {
197  evt.getByToken(token, handle);
198  ptr = handle.product();
199  return handle; //return handle to keep alive pointer (safety first)
200 }
std::vector< MonitorElement * > Charge_Vs_PathlengthTOB
const std::vector< double > * chargeoverpath
edm::EDGetTokenT< std::vector< double > > gainused_token_
const std::vector< int > * trackalgo
edm::EDGetTokenT< std::vector< double > > localdirz_token_
edm::EDGetTokenT< std::vector< bool > > saturation_token_
edm::EDGetTokenT< std::vector< double > > trackchi2ndof_token_
virtual void checkBookAPVColls(const edm::EventSetup &setup)
bool getByToken(EDGetToken token, Handle< PROD > &result) const
Definition: Event.h:457
edm::EDGetTokenT< std::vector< float > > trackp_token_
SiStripGainsPCLWorker(const edm::ParameterSet &)
const TrackerGeometry * bareTkGeomPtr_
virtual void analyze(const edm::Event &, const edm::EventSetup &)
const std::vector< bool > * TrigTech
def setup(process, global_tag, zero_tesla=False)
Definition: GeneralSetup.py:1
virtual void dqmBeginRun(edm::Run const &, edm::EventSetup const &)
const std::vector< int > * trackindex
const std::vector< float > * trackpt
const std::vector< unsigned int > * rawid
std::vector< std::shared_ptr< stAPVGain > > APVsCollOrdered
const std::vector< unsigned int > * charge
const std::vector< double > * path
const std::vector< bool > * farfromedge
edm::EDGetTokenT< std::vector< unsigned int > > trackhitsvalid_token_
edm::EDGetTokenT< std::vector< unsigned short > > firststrip_token_
edm::EDGetTokenT< std::vector< bool > > farfromedge_token_
edm::EDGetTokenT< std::vector< bool > > overlapping_token_
std::vector< std::string > dqm_tag_
edm::EDGetTokenT< std::vector< unsigned short > > nstrips_token_
const std::vector< double > * tracketa
edm::EDGetTokenT< std::vector< double > > tracketa_token_
const std::vector< double > * localdiry
const std::vector< float > * trackp
const std::vector< bool > * saturation
edm::ESHandle< TrackerGeometry > tkGeom_
std::unordered_map< unsigned int, std::shared_ptr< stAPVGain > > APVsColl
const std::vector< double > * localdirz
const std::vector< double > * trackphi
std::vector< MonitorElement * > Charge_Vs_PathlengthTIB
const std::vector< bool > * overlapping
edm::EDGetTokenT< std::vector< int > > trackindex_token_
const std::vector< double > * localdirx
edm::EDGetTokenT< std::vector< double > > localdirx_token_
edm::EDGetTokenT< std::vector< unsigned int > > charge_token_
std::vector< MonitorElement * > Charge_Vs_PathlengthTECP1
edm::EDGetTokenT< std::vector< double > > trackphi_token_
const std::vector< unsigned short > * firststrip
const std::vector< unsigned int > * trackhitsvalid
std::vector< MonitorElement * > Charge_Vs_PathlengthTECM2
T const * product() const
Definition: Handle.h:81
edm::EDGetTokenT< std::vector< float > > trackpt_token_
edm::Handle< T > connect(const T *&ptr, edm::EDGetTokenT< T > token, const edm::Event &evt)
edm::EDGetTokenT< std::vector< double > > path_token_
std::vector< MonitorElement * > Charge_Vs_PathlengthTECM1
const std::vector< unsigned char > * amplitude
int statCollectionFromMode(const char *tag) const
edm::EDGetTokenT< std::vector< double > > chargeoverpath_token_
const std::vector< double > * trackchi2ndof
edm::EDGetTokenT< std::vector< int > > trackalgo_token_
std::vector< MonitorElement * > Charge_Vs_PathlengthTECP2
edm::EDGetTokenT< std::vector< double > > localdiry_token_
std::vector< MonitorElement * > Charge_Vs_PathlengthTIDP
long double T
edm::EDGetTokenT< std::vector< unsigned char > > amplitude_token_
const std::vector< unsigned short > * nstrips
virtual void bookHistograms(DQMStore::IBooker &, edm::Run const &, edm::EventSetup const &)
std::vector< MonitorElement * > Charge_Vs_PathlengthTIDM
static void fillDescriptions(edm::ConfigurationDescriptions &descriptions)
Definition: Run.h:42
const std::vector< double > * gainused
edm::EDGetTokenT< std::vector< unsigned int > > rawid_token_
std::vector< MonitorElement * > Charge_Vs_Index
edm::EDGetTokenT< std::vector< bool > > TrigTech_token_