CMS 3D CMS Logo

LaserAlignment.h
Go to the documentation of this file.
1 
2 #ifndef LaserAlignment_LaserAlignment_H
3 #define LaserAlignment_LaserAlignment_H
4 
14 #include <sstream>
15 #include <iostream>
16 #include <cmath>
17 
25 
32 
37 
42 
49 
51 
63 
65 
66 #include "TH1.h"
67 #include "TFile.h"
68 #include "TF1.h"
69 
73 class LaserAlignment : public edm::one::EDProducer<edm::EndRunProducer> {
74 public:
75  explicit LaserAlignment(edm::ParameterSet const& theConf);
76  ~LaserAlignment() override;
77  void beginJob() override;
78  void produce(edm::Event&, edm::EventSetup const&) override;
79  void endJob() override;
80  void endRunProduce(edm::Run&, const edm::EventSetup&) override;
81 
83  void testRoutine(void);
84 
85 private:
87  void fillDataProfiles(edm::Event const&, edm::EventSetup const&);
88 
91 
93  bool isTECBeam(void);
94  bool isATBeam(void);
95 
97  double getTIBTOBNominalBeamOffset(unsigned int, unsigned int, unsigned int);
98 
100  double getTEC2TECNominalBeamOffset(unsigned int, unsigned int, unsigned int);
101 
103  void fillDetectorId(void);
104 
106  double ConvertAngle(double);
107 
109  void CalculateNominalCoordinates(void);
110 
113 
115  void DumpStripFileSet(LASGlobalData<std::pair<float, float> >&);
116 
119 
124 
129 
132 
135 
138 
141 
144 
147 
150 
153 
156 
159 
160  // digi producer
161  std::vector<edm::ParameterSet> theDigiProducersList;
162 
165 
168 
171 
173  std::vector<unsigned int> theMaskTecModules;
174  std::vector<unsigned int> theMaskAtModules;
175 
178 
179  // this object can judge if
180  // a LASModuleProfile is usable for position measurement
182 
183  // colection of constants
185 
186  // the detector ids for all the modules
188 
189  // the detector ids for the doubly hit modules in the TECs
190  std::vector<unsigned int> tecDoubleHitDetId;
191 
192  // all the 474 profiles for the pedestals
194 
197 
198  // summed data profiles
200 
201  // 474 names for retrieving data from the branches
203 
204  // number of accepted profiles for each module
206 
207  // hit map for the current event (int=0,1)
208  // which is needed for branching into AT or TEC mode
210 
211  // histograms for the summed profiles;
212  // these are needed for the fitting procedure (done by ROOT)
214 
215  // container for nominal module positions
217 
218  // a class for easy looping over LASGlobalData objects,
219  // avoids nested for-statements
221 
223  TFile* theFile;
224  TDirectory* singleModulesDir;
225 
230 
232 
234 
236 };
237 #endif
bool isATBeam(void)
unsigned int judgeOverdriveThreshold
config parameters for the LASProfileJudge
void fillDataProfiles(edm::Event const &, edm::EventSetup const &)
fill profiles from SiStrip(Raw)Digi container
void beginJob() override
bool theSaveHistograms
config switch
void ApplyEndcapMaskingCorrections(LASGlobalData< LASCoordinateSet > &, LASGlobalData< LASCoordinateSet > &, LASEndcapAlignmentParameterSet &)
apply endcap correction to masked modules in TEC
void produce(edm::Event &, edm::EventSetup const &) override
bool misalignedByRefGeometry
config switch
std::string theAlignRecordName
bool isTECBeam(void)
decide whether TEC or AT beams have fired
LaserAlignment(edm::ParameterSet const &theConf)
double getTIBTOBNominalBeamOffset(unsigned int, unsigned int, unsigned int)
returns the nominal beam position (strips) in TOB for the profileJudge
edm::ESHandle< TrackerGeometry > theTrackerGeometry
double peakFinderThreshold
config parameter
void DumpHitmaps(LASGlobalData< int > &)
for debugging only, will disappear
void DumpPosFileSet(LASGlobalData< LASCoordinateSet > &)
for debugging only, will disappear
LASGlobalData< int > numberOfAcceptedProfiles
bool theDoPedestalSubtraction
config switch
LASGlobalData< LASModuleProfile > currentDataProfiles
data profiles for the current event
std::vector< unsigned int > theMaskTecModules
config parameters
bool theUseMinuitAlgorithm
config switch
TFile * theFile
Tree stuff.
LASGlobalData< int > isAcceptedProfile
std::vector< edm::ParameterSet > theDigiProducersList
void DumpStripFileSet(LASGlobalData< std::pair< float, float > > &)
for debugging only, will disappear
void fillPedestalProfiles(edm::ESHandle< SiStripPedestals > &)
fill pedestals from dbase
~LaserAlignment() override
LASGlobalData< TH1D * > summedHistograms
TDirectory * singleModulesDir
double ConvertAngle(double)
convert an angle in the [-pi,pi] range to the [0,2*pi] range
edm::ESHandle< Alignments > theGlobalPositionRcd
std::string theFileName
config parameter (histograms file output name)
void endJob() override
std::vector< unsigned int > tecDoubleHitDetId
void endRunProduce(edm::Run &, const edm::EventSetup &) override
bool theApplyBeamKinkCorrections
config switch
void CalculateNominalCoordinates(void)
fills a LASGlobalData<LASCoordinateSet> with nominal module positions
std::string theErrorRecordName
bool theStoreToDB
config switch
LASGlobalData< LASModuleProfile > pedestalProfiles
LASGlobalData< LASCoordinateSet > nominalCoordinates
AlignableTracker * theAlignableTracker
int theEvents
counter for the total number of events processed
LASConstants theLasConstants
double getTEC2TECNominalBeamOffset(unsigned int, unsigned int, unsigned int)
returns the nominal beam position (strips) in TEC (AT) for the profileJudge
LASGlobalData< std::string > theProfileNames
std::vector< unsigned int > theMaskAtModules
void ApplyATMaskingCorrections(LASGlobalData< LASCoordinateSet > &, LASGlobalData< LASCoordinateSet > &, LASBarrelAlignmentParameterSet &)
same for alignment tube modules
void testRoutine(void)
for debugging & testing only, will disappear..
LASGlobalData< LASModuleProfile > collectedDataProfiles
void fillDetectorId(void)
fill hard coded detIds
int theCompression
config parameter (histograms file compression level)
LASGlobalData< unsigned int > detectorId
bool enableJudgeZeroFilter
config switch
edm::ESHandle< GeometricDet > gD
tracker geometry;
Definition: Run.h:45
LASGlobalLoop moduleLoop
LASProfileJudge judge
bool updateFromInputGeometry
config switch
bool theSetNominalStrips
config switch