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 
137 
140 
143 
146 
149 
152 
155 
158 
161 
164 
167 
168  // digi producer
169  std::vector<edm::ParameterSet> theDigiProducersList;
170 
173 
176 
179 
181  std::vector<unsigned int> theMaskTecModules;
182  std::vector<unsigned int> theMaskAtModules;
183 
186 
187  // this object can judge if
188  // a LASModuleProfile is usable for position measurement
190 
191  // colection of constants
193 
194  // the detector ids for all the modules
196 
197  // the detector ids for the doubly hit modules in the TECs
198  std::vector<unsigned int> tecDoubleHitDetId;
199 
200  // all the 474 profiles for the pedestals
202 
205 
206  // summed data profiles
208 
209  // 474 names for retrieving data from the branches
211 
212  // number of accepted profiles for each module
214 
215  // hit map for the current event (int=0,1)
216  // which is needed for branching into AT or TEC mode
218 
219  // histograms for the summed profiles;
220  // these are needed for the fitting procedure (done by ROOT)
222 
223  // container for nominal module positions
225 
226  // a class for easy looping over LASGlobalData objects,
227  // avoids nested for-statements
229 
231  TFile* theFile;
232  TDirectory* singleModulesDir;
233 
238 
240 
242 
244 };
245 #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
const edm::ESGetToken< PTrackerParameters, PTrackerParametersRcd > ptpToken_
bool theSaveHistograms
config switch
const edm::ESGetToken< GeometricDet, IdealGeometryRecord > geomDetToken_
void ApplyEndcapMaskingCorrections(LASGlobalData< LASCoordinateSet > &, LASGlobalData< LASCoordinateSet > &, LASEndcapAlignmentParameterSet &)
apply endcap correction to masked modules in TEC
void produce(edm::Event &, edm::EventSetup const &) override
const edm::ESGetToken< SiStripPedestals, SiStripPedestalsRcd > stripPedestalsToken_
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
const edm::ESGetToken< TrackerGeometry, TrackerDigiGeometryRecord > geomToken_
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)
const edm::ESGetToken< TrackerTopology, TrackerTopologyRcd > topoToken_
Tokens for ESconsumes.
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
const edm::ESGetToken< Alignments, GlobalPositionRcd > gprToken_
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