CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
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 
138 
141 
144 
147 
150 
153 
156 
159 
162 
165 
168 
169  // digi producer
170  std::vector<edm::ParameterSet> theDigiProducersList;
171 
174 
177 
180 
182  std::vector<unsigned int> theMaskTecModules;
183  std::vector<unsigned int> theMaskAtModules;
184 
187 
188  // this object can judge if
189  // a LASModuleProfile is usable for position measurement
191 
192  // colection of constants
194 
195  // the detector ids for all the modules
197 
198  // the detector ids for the doubly hit modules in the TECs
199  std::vector<unsigned int> tecDoubleHitDetId;
200 
201  // all the 474 profiles for the pedestals
203 
206 
207  // summed data profiles
209 
210  // 474 names for retrieving data from the branches
212 
213  // number of accepted profiles for each module
215 
216  // hit map for the current event (int=0,1)
217  // which is needed for branching into AT or TEC mode
219 
220  // histograms for the summed profiles;
221  // these are needed for the fitting procedure (done by ROOT)
223 
224  // container for nominal module positions
226 
227  // a class for easy looping over LASGlobalData objects,
228  // avoids nested for-statements
230 
232  TFile* theFile;
233  TDirectory* singleModulesDir;
234 
239 
241 
243 
245 };
246 #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
const edm::ESGetToken< PTrackerAdditionalParametersPerDet, PTrackerAdditionalParametersPerDetRcd > ptitpToken_
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&lt;LASCoordinateSet&gt; 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 &amp; 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