CMS 3D CMS Logo

List of all members | Public Member Functions | Private Member Functions | Private Attributes
LaserAlignment Class Reference

#include <LaserAlignment.h>

Inheritance diagram for LaserAlignment:
edm::one::EDProducer< edm::EndRunProducer > edm::one::EDProducerBase edm::ProducerBase edm::EDConsumerBase edm::ProductRegistryHelper

Public Member Functions

void beginJob () override
 
void endJob () override
 
void endRunProduce (edm::Run &, const edm::EventSetup &) override
 
 LaserAlignment (edm::ParameterSet const &theConf)
 
void produce (edm::Event &, edm::EventSetup const &) override
 
void testRoutine (void)
 for debugging & testing only, will disappear.. More...
 
 ~LaserAlignment () override
 
- Public Member Functions inherited from edm::one::EDProducer< edm::EndRunProducer >
 EDProducer ()=default
 
 EDProducer (const EDProducer &)=delete
 
SerialTaskQueueglobalLuminosityBlocksQueue () final
 
SerialTaskQueueglobalRunsQueue () final
 
bool hasAbilityToProduceInBeginLumis () const final
 
bool hasAbilityToProduceInBeginProcessBlocks () const final
 
bool hasAbilityToProduceInBeginRuns () const final
 
bool hasAbilityToProduceInEndLumis () const final
 
bool hasAbilityToProduceInEndProcessBlocks () const final
 
bool hasAbilityToProduceInEndRuns () const final
 
const EDProduceroperator= (const EDProducer &)=delete
 
bool wantsGlobalLuminosityBlocks () const final
 
bool wantsGlobalRuns () const final
 
bool wantsInputProcessBlocks () const final
 
bool wantsProcessBlocks () const final
 
- Public Member Functions inherited from edm::one::EDProducerBase
 EDProducerBase ()
 
ModuleDescription const & moduleDescription () const
 
bool wantsStreamLuminosityBlocks () const
 
bool wantsStreamRuns () const
 
 ~EDProducerBase () override
 
- Public Member Functions inherited from edm::ProducerBase
void callWhenNewProductsRegistered (std::function< void(BranchDescription const &)> const &func)
 
std::vector< edm::ProductResolverIndex > const & indiciesForPutProducts (BranchType iBranchType) const
 
 ProducerBase ()
 
std::vector< edm::ProductResolverIndex > const & putTokenIndexToProductResolverIndex () const
 
std::vector< bool > const & recordProvenanceList () const
 
void registerProducts (ProducerBase *, ProductRegistry *, ModuleDescription const &)
 
std::function< void(BranchDescription const &)> registrationCallback () const
 used by the fwk to register list of products More...
 
void resolvePutIndicies (BranchType iBranchType, ModuleToResolverIndicies const &iIndicies, std::string const &moduleLabel)
 
TypeLabelList const & typeLabelList () const
 used by the fwk to register the list of products of this module More...
 
 ~ProducerBase () noexcept(false) override
 
- Public Member Functions inherited from edm::EDConsumerBase
std::vector< ConsumesInfoconsumesInfo () const
 
void convertCurrentProcessAlias (std::string const &processName)
 Convert "@currentProcess" in InputTag process names to the actual current process name. More...
 
 EDConsumerBase ()
 
 EDConsumerBase (EDConsumerBase &&)=default
 
 EDConsumerBase (EDConsumerBase const &)=delete
 
ESProxyIndex const * esGetTokenIndices (edm::Transition iTrans) const
 
std::vector< ESProxyIndex > const & esGetTokenIndicesVector (edm::Transition iTrans) const
 
std::vector< ESRecordIndex > const & esGetTokenRecordIndicesVector (edm::Transition iTrans) const
 
ProductResolverIndexAndSkipBit indexFrom (EDGetToken, BranchType, TypeID const &) const
 
void itemsMayGet (BranchType, std::vector< ProductResolverIndexAndSkipBit > &) const
 
void itemsToGet (BranchType, std::vector< ProductResolverIndexAndSkipBit > &) const
 
std::vector< ProductResolverIndexAndSkipBit > const & itemsToGetFrom (BranchType iType) const
 
void labelsForToken (EDGetToken iToken, Labels &oLabels) const
 
void modulesWhoseProductsAreConsumed (std::array< std::vector< ModuleDescription const * > *, NumBranchTypes > &modulesAll, std::vector< ModuleProcessName > &modulesInPreviousProcesses, ProductRegistry const &preg, std::map< std::string, ModuleDescription const * > const &labelsToDesc, std::string const &processName) const
 
EDConsumerBaseoperator= (EDConsumerBase &&)=default
 
EDConsumerBase const & operator= (EDConsumerBase const &)=delete
 
bool registeredToConsume (ProductResolverIndex, bool, BranchType) const
 
bool registeredToConsumeMany (TypeID const &, BranchType) const
 
void selectInputProcessBlocks (ProductRegistry const &productRegistry, ProcessBlockHelperBase const &processBlockHelperBase)
 
ProductResolverIndexAndSkipBit uncheckedIndexFrom (EDGetToken) const
 
void updateLookup (BranchType iBranchType, ProductResolverIndexHelper const &, bool iPrefetchMayGet)
 
void updateLookup (eventsetup::ESRecordsToProxyIndices const &)
 
virtual ~EDConsumerBase () noexcept(false)
 

Private Member Functions

void ApplyATMaskingCorrections (LASGlobalData< LASCoordinateSet > &, LASGlobalData< LASCoordinateSet > &, LASBarrelAlignmentParameterSet &)
 same for alignment tube modules More...
 
void ApplyEndcapMaskingCorrections (LASGlobalData< LASCoordinateSet > &, LASGlobalData< LASCoordinateSet > &, LASEndcapAlignmentParameterSet &)
 apply endcap correction to masked modules in TEC More...
 
void CalculateNominalCoordinates (void)
 fills a LASGlobalData<LASCoordinateSet> with nominal module positions More...
 
double ConvertAngle (double)
 convert an angle in the [-pi,pi] range to the [0,2*pi] range More...
 
void DumpHitmaps (LASGlobalData< int > &)
 for debugging only, will disappear More...
 
void DumpPosFileSet (LASGlobalData< LASCoordinateSet > &)
 for debugging only, will disappear More...
 
void DumpStripFileSet (LASGlobalData< std::pair< float, float > > &)
 for debugging only, will disappear More...
 
void fillDataProfiles (edm::Event const &, edm::EventSetup const &)
 fill profiles from SiStrip(Raw)Digi container More...
 
void fillDetectorId (void)
 fill hard coded detIds More...
 
void fillPedestalProfiles (edm::ESHandle< SiStripPedestals > &)
 fill pedestals from dbase More...
 
double getTEC2TECNominalBeamOffset (unsigned int, unsigned int, unsigned int)
 returns the nominal beam position (strips) in TEC (AT) for the profileJudge More...
 
double getTIBTOBNominalBeamOffset (unsigned int, unsigned int, unsigned int)
 returns the nominal beam position (strips) in TOB for the profileJudge More...
 
bool isATBeam (void)
 
bool isTECBeam (void)
 decide whether TEC or AT beams have fired More...
 

Private Attributes

LASGlobalData< LASModuleProfilecollectedDataProfiles
 
LASGlobalData< LASModuleProfilecurrentDataProfiles
 data profiles for the current event More...
 
LASGlobalData< unsigned int > detectorId
 
bool enableJudgeZeroFilter
 config switch More...
 
bool firstEvent_
 
edm::ESHandle< GeometricDetgD
 tracker geometry; More...
 
const edm::ESGetToken< GeometricDet, IdealGeometryRecordgeomDetToken_
 
const edm::ESGetToken< TrackerGeometry, TrackerDigiGeometryRecordgeomToken_
 
const edm::ESGetToken< Alignments, GlobalPositionRcdgprToken_
 
LASGlobalData< int > isAcceptedProfile
 
LASProfileJudge judge
 
unsigned int judgeOverdriveThreshold
 config parameters for the LASProfileJudge More...
 
bool misalignedByRefGeometry
 config switch More...
 
LASGlobalLoop moduleLoop
 
LASGlobalData< LASCoordinateSetnominalCoordinates
 
LASGlobalData< int > numberOfAcceptedProfiles
 
double peakFinderThreshold
 config parameter More...
 
LASGlobalData< LASModuleProfilepedestalProfiles
 
const edm::ESGetToken< PTrackerAdditionalParametersPerDet, PTrackerAdditionalParametersPerDetRcdptitpToken_
 
const edm::ESGetToken< PTrackerParameters, PTrackerParametersRcdptpToken_
 
TDirectory * singleModulesDir
 
const edm::ESGetToken< SiStripPedestals, SiStripPedestalsRcdstripPedestalsToken_
 
LASGlobalData< TH1D * > summedHistograms
 
std::vector< unsigned int > tecDoubleHitDetId
 
AlignableTrackertheAlignableTracker
 
std::string theAlignRecordName
 
bool theApplyBeamKinkCorrections
 config switch More...
 
int theCompression
 config parameter (histograms file compression level) More...
 
std::vector< edm::ParameterSettheDigiProducersList
 
bool theDoPedestalSubtraction
 config switch More...
 
std::string theErrorRecordName
 
int theEvents
 counter for the total number of events processed More...
 
TFile * theFile
 Tree stuff. More...
 
std::string theFileName
 config parameter (histograms file output name) More...
 
edm::ESHandle< AlignmentstheGlobalPositionRcd
 
LASConstants theLasConstants
 
std::vector< unsigned int > theMaskAtModules
 
std::vector< unsigned int > theMaskTecModules
 config parameters More...
 
LASGlobalData< std::string > theProfileNames
 
bool theSaveHistograms
 config switch More...
 
bool theSetNominalStrips
 config switch More...
 
bool theStoreToDB
 config switch More...
 
edm::ESHandle< TrackerGeometrytheTrackerGeometry
 
bool theUseMinuitAlgorithm
 config switch More...
 
const edm::ESGetToken< TrackerTopology, TrackerTopologyRcdtopoToken_
 Tokens for ESconsumes. More...
 
bool updateFromInputGeometry
 config switch More...
 

Additional Inherited Members

- Public Types inherited from edm::one::EDProducerBase
typedef EDProducerBase ModuleType
 
- Public Types inherited from edm::ProducerBase
using ModuleToResolverIndicies = std::unordered_multimap< std::string, std::tuple< edm::TypeID const *, const char *, edm::ProductResolverIndex > >
 
typedef ProductRegistryHelper::TypeLabelList TypeLabelList
 
- Public Types inherited from edm::EDConsumerBase
typedef ProductLabels Labels
 
- Static Public Member Functions inherited from edm::one::EDProducerBase
static const std::string & baseType ()
 
static void fillDescriptions (ConfigurationDescriptions &descriptions)
 
static void prevalidate (ConfigurationDescriptions &descriptions)
 
- Protected Member Functions inherited from edm::ProducerBase
template<class ProductType >
BranchAliasSetterT< ProductType > produces ()
 declare what type of product will make and with which optional label More...
 
template<typename ProductType , BranchType B>
BranchAliasSetterT< ProductType > produces ()
 
template<typename ProductType , Transition B>
BranchAliasSetterT< ProductType > produces ()
 
BranchAliasSetter produces (const TypeID &id, std::string instanceName=std::string(), bool recordProvenance=true)
 
template<BranchType B>
BranchAliasSetter produces (const TypeID &id, std::string instanceName=std::string(), bool recordProvenance=true)
 
template<Transition B>
BranchAliasSetter produces (const TypeID &id, std::string instanceName=std::string(), bool recordProvenance=true)
 
template<typename ProductType , Transition B>
BranchAliasSetterT< ProductType > produces (std::string instanceName)
 
template<class ProductType >
BranchAliasSetterT< ProductType > produces (std::string instanceName)
 
template<typename ProductType , BranchType B>
BranchAliasSetterT< ProductType > produces (std::string instanceName)
 
ProducesCollector producesCollector ()
 
- Protected Member Functions inherited from edm::EDConsumerBase
EDGetToken consumes (const TypeToGet &id, edm::InputTag const &tag)
 
template<typename ProductType , BranchType B = InEvent>
EDGetTokenT< ProductType > consumes (edm::InputTag const &tag)
 
template<BranchType B = InEvent>
EDConsumerBaseAdaptor< B > consumes (edm::InputTag tag) noexcept
 
template<BranchType B>
EDGetToken consumes (TypeToGet const &id, edm::InputTag const &tag)
 
ConsumesCollector consumesCollector ()
 Use a ConsumesCollector to gather consumes information from helper functions. More...
 
template<typename ProductType , BranchType B = InEvent>
void consumesMany ()
 
void consumesMany (const TypeToGet &id)
 
template<BranchType B>
void consumesMany (const TypeToGet &id)
 
template<typename ESProduct , typename ESRecord , Transition Tr = Transition::Event>
auto esConsumes ()
 
template<Transition Tr = Transition::Event>
constexpr auto esConsumes () noexcept
 
template<typename ESProduct , typename ESRecord , Transition Tr = Transition::Event>
auto esConsumes (ESInputTag const &tag)
 
template<Transition Tr = Transition::Event>
auto esConsumes (ESInputTag tag) noexcept
 
template<Transition Tr = Transition::Event>
ESGetTokenGeneric esConsumes (eventsetup::EventSetupRecordKey const &iRecord, eventsetup::DataKey const &iKey)
 Used with EventSetupRecord::doGet. More...
 
EDGetToken mayConsume (const TypeToGet &id, edm::InputTag const &tag)
 
template<BranchType B>
EDGetToken mayConsume (const TypeToGet &id, edm::InputTag const &tag)
 
template<typename ProductType , BranchType B = InEvent>
EDGetTokenT< ProductType > mayConsume (edm::InputTag const &tag)
 

Detailed Description

Main reconstruction module for the Laser Alignment System

Date
2012/12/26 20:34:44
Revision
1.32
Author
Maarten Thomas
Jan Olzem

Definition at line 73 of file LaserAlignment.h.

Constructor & Destructor Documentation

◆ LaserAlignment()

LaserAlignment::LaserAlignment ( edm::ParameterSet const &  theConf)
explicit

Definition at line 21 of file LaserAlignment.cc.

29  theEvents(0),
30  theDoPedestalSubtraction(theConf.getUntrackedParameter<bool>("SubtractPedestals", true)),
31  theUseMinuitAlgorithm(theConf.getUntrackedParameter<bool>("RunMinuitAlignmentTubeAlgorithm", false)),
32  theApplyBeamKinkCorrections(theConf.getUntrackedParameter<bool>("ApplyBeamKinkCorrections", true)),
33  peakFinderThreshold(theConf.getUntrackedParameter<double>("PeakFinderThreshold", 10.)),
34  enableJudgeZeroFilter(theConf.getUntrackedParameter<bool>("EnableJudgeZeroFilter", true)),
35  judgeOverdriveThreshold(theConf.getUntrackedParameter<unsigned int>("JudgeOverdriveThreshold", 220)),
36  updateFromInputGeometry(theConf.getUntrackedParameter<bool>("UpdateFromInputGeometry", false)),
37  misalignedByRefGeometry(theConf.getUntrackedParameter<bool>("MisalignedByRefGeometry", false)),
38  theStoreToDB(theConf.getUntrackedParameter<bool>("SaveToDbase", false)),
39  theDigiProducersList(theConf.getParameter<std::vector<edm::ParameterSet> >("DigiProducersList")),
40  theSaveHistograms(theConf.getUntrackedParameter<bool>("SaveHistograms", false)),
41  theCompression(theConf.getUntrackedParameter<int>("ROOTFileCompression", 1)),
42  theFileName(theConf.getUntrackedParameter<std::string>("ROOTFileName", "test.root")),
43  theMaskTecModules(theConf.getUntrackedParameter<std::vector<unsigned int> >("MaskTECModules")),
44  theMaskAtModules(theConf.getUntrackedParameter<std::vector<unsigned int> >("MaskATModules")),
45  theSetNominalStrips(theConf.getUntrackedParameter<bool>("ForceFitterToNominalStrips", false)),
46  theLasConstants(theConf.getUntrackedParameter<std::vector<edm::ParameterSet> >("LaserAlignmentConstants")),
47  theFile(),
49  theAlignRecordName("TrackerAlignmentRcd"),
50  theErrorRecordName("TrackerAlignmentErrorExtendedRcd"),
51  firstEvent_(true) {
52  std::cout << std::endl;
53  std::cout << "=============================================================="
54  << "\n=== LaserAlignment module configuration ==="
55  << "\n"
56  << "\n Write histograms to file = " << (theSaveHistograms ? "true" : "false")
57  << "\n Histogram file name = " << theFileName
58  << "\n Histogram file compression = " << theCompression
59  << "\n Subtract pedestals = " << (theDoPedestalSubtraction ? "true" : "false")
60  << "\n Run Minuit AT algorithm = " << (theUseMinuitAlgorithm ? "true" : "false")
61  << "\n Apply beam kink corrections = " << (theApplyBeamKinkCorrections ? "true" : "false")
62  << "\n Peak Finder Threshold = " << peakFinderThreshold
63  << "\n EnableJudgeZeroFilter = " << (enableJudgeZeroFilter ? "true" : "false")
64  << "\n JudgeOverdriveThreshold = " << judgeOverdriveThreshold
65  << "\n Update from input geometry = " << (updateFromInputGeometry ? "true" : "false")
66  << "\n Misalignment from ref geometry = " << (misalignedByRefGeometry ? "true" : "false")
67  << "\n Number of TEC modules masked = " << theMaskTecModules.size() << " (s. below list if > 0)"
68  << "\n Number of AT modules masked = " << theMaskAtModules.size() << " (s. below list if > 0)"
69  << "\n Store to database = " << (theStoreToDB ? "true" : "false")
70  << "\n ----------------------------------------------- ----------"
71  << (theSetNominalStrips ? "\n Set strips to nominal = true" : "\n")
72  << "\n=============================================================" << std::endl;
73 
74  // tell about masked modules
75  if (!theMaskTecModules.empty()) {
76  std::cout << " ===============================================================================================\n"
77  << std::flush;
78  std::cout << " The following " << theMaskTecModules.size()
79  << " TEC modules have been masked out and will not be considered by the TEC algorithm:\n " << std::flush;
80  for (std::vector<unsigned int>::iterator moduleIt = theMaskTecModules.begin(); moduleIt != theMaskTecModules.end();
81  ++moduleIt) {
82  std::cout << *moduleIt << (moduleIt != --theMaskTecModules.end() ? ", " : "") << std::flush;
83  }
84  std::cout << std::endl << std::flush;
85  std::cout << " ===============================================================================================\n\n"
86  << std::flush;
87  }
88  if (!theMaskAtModules.empty()) {
89  std::cout << " ===============================================================================================\n"
90  << std::flush;
91  std::cout << " The following " << theMaskAtModules.size()
92  << " AT modules have been masked out and will not be considered by the AT algorithm:\n " << std::flush;
93  for (std::vector<unsigned int>::iterator moduleIt = theMaskAtModules.begin(); moduleIt != theMaskAtModules.end();
94  ++moduleIt) {
95  std::cout << *moduleIt << (moduleIt != --theMaskAtModules.end() ? ", " : "") << std::flush;
96  }
97  std::cout << std::endl << std::flush;
98  std::cout << " ===============================================================================================\n\n"
99  << std::flush;
100  }
101 
102  // alias for the Branches in the root files
103  std::string alias(theConf.getParameter<std::string>("@module_label"));
104 
105  // declare the product to produce
106  produces<TkLasBeamCollection, edm::Transition::EndRun>("tkLaserBeams").setBranchAlias(alias + "TkLasBeamCollection");
107 
108  // switch judge's zero filter depending on cfg
110 
111  // set the upper threshold for zero suppressed data
113 }

References SiStripOfflineCRack_cfg::alias, gather_cfg::cout, enableJudgeZeroFilter, LASProfileJudge::EnableZeroFilter(), edm::ParameterSet::getParameter(), judge, judgeOverdriveThreshold, misalignedByRefGeometry, peakFinderThreshold, LASProfileJudge::SetOverdriveThreshold(), AlCaHLTBitMon_QueryRunRegistry::string, theApplyBeamKinkCorrections, theCompression, theDoPedestalSubtraction, theFileName, theMaskAtModules, theMaskTecModules, theSaveHistograms, theSetNominalStrips, theStoreToDB, theUseMinuitAlgorithm, and updateFromInputGeometry.

◆ ~LaserAlignment()

LaserAlignment::~LaserAlignment ( )
override

Definition at line 118 of file LaserAlignment.cc.

118  {
119  if (theSaveHistograms)
120  theFile->Write();
121  if (theFile) {
122  delete theFile;
123  }
124  if (theAlignableTracker) {
125  delete theAlignableTracker;
126  }
127 }

References theAlignableTracker, theFile, and theSaveHistograms.

Member Function Documentation

◆ ApplyATMaskingCorrections()

void LaserAlignment::ApplyATMaskingCorrections ( LASGlobalData< LASCoordinateSet > &  measuredCoordinates,
LASGlobalData< LASCoordinateSet > &  nominalCoordinates,
LASBarrelAlignmentParameterSet atParameters 
)
private

same for alignment tube modules

loop the list of alignment tube modules to be masked and apply the corrections from the "barrelParameters" to them

Definition at line 1624 of file LaserAlignment.cc.

1626  {
1627  // loop the list of modules to be masked
1628  for (std::vector<unsigned int>::iterator moduleIt = theMaskAtModules.begin(); moduleIt != theMaskAtModules.end();
1629  ++moduleIt) {
1630  // loop variables
1632  int det, beam, disk, pos;
1633 
1634  // this will calculate the corrections from the alignment parameters
1635  LASAlignmentTubeAlgorithm atAlgorithm;
1636 
1637  // find the location of the respective module in the container with these loops:
1638 
1639  // first TIB+TOB
1640  det = 2;
1641  beam = 0;
1642  pos = 0;
1643  do {
1644  // here we got it
1645  if (detectorId.GetTIBTOBEntry(det, beam, pos) == *moduleIt) {
1646  // the nominal phi value for this module
1647  const double nominalPhi = nominalCoordinates.GetTIBTOBEntry(det, beam, pos).GetPhi();
1648 
1649  // the offset from the alignment parameters
1650  const double phiCorrection =
1651  atAlgorithm.GetTIBTOBAlignmentParameterCorrection(det, beam, pos, nominalCoordinates, atParameters);
1652 
1653  // apply the corrections
1654  measuredCoordinates.GetTIBTOBEntry(det, beam, pos).SetPhi(nominalPhi - phiCorrection);
1655  }
1656 
1657  } while (moduleLoop.TIBTOBLoop(det, beam, pos));
1658 
1659  // then TEC(AT)
1660  det = 0;
1661  beam = 0;
1662  disk = 0;
1663  do {
1664  // here we got it
1665  if (detectorId.GetTEC2TECEntry(det, beam, disk) == *moduleIt) {
1666  // the nominal phi value for this module
1667  const double nominalPhi = nominalCoordinates.GetTEC2TECEntry(det, beam, disk).GetPhi();
1668 
1669  // the offset from the alignment parameters
1670  const double phiCorrection =
1671  atAlgorithm.GetTEC2TECAlignmentParameterCorrection(det, beam, disk, nominalCoordinates, atParameters);
1672 
1673  // apply the corrections
1674  measuredCoordinates.GetTEC2TECEntry(det, beam, disk).SetPhi(nominalPhi - phiCorrection);
1675  }
1676 
1677  } while (moduleLoop.TEC2TECLoop(det, beam, disk));
1678  }
1679 }

References EcalCondDBWriter_cfi::beam, detectorId, LASCoordinateSet::GetPhi(), LASAlignmentTubeAlgorithm::GetTEC2TECAlignmentParameterCorrection(), LASGlobalData< T >::GetTEC2TECEntry(), LASAlignmentTubeAlgorithm::GetTIBTOBAlignmentParameterCorrection(), LASGlobalData< T >::GetTIBTOBEntry(), moduleLoop, nominalCoordinates, LASCoordinateSet::SetPhi(), LASGlobalLoop::TEC2TECLoop(), theMaskAtModules, and LASGlobalLoop::TIBTOBLoop().

Referenced by endRunProduce().

◆ ApplyEndcapMaskingCorrections()

void LaserAlignment::ApplyEndcapMaskingCorrections ( LASGlobalData< LASCoordinateSet > &  measuredCoordinates,
LASGlobalData< LASCoordinateSet > &  nominalCoordinates,
LASEndcapAlignmentParameterSet endcapParameters 
)
private

apply endcap correction to masked modules in TEC

loop the list of endcap modules to be masked and apply the corrections from the "endcapParameters" to them

Definition at line 1584 of file LaserAlignment.cc.

1586  {
1587  // loop the list of modules to be masked
1588  for (std::vector<unsigned int>::iterator moduleIt = theMaskTecModules.begin(); moduleIt != theMaskTecModules.end();
1589  ++moduleIt) {
1590  // loop variables
1592  int det, ring, beam, disk;
1593 
1594  // this will calculate the corrections from the alignment parameters
1595  LASEndcapAlgorithm endcapAlgorithm;
1596 
1597  // find the location of the respective module in the container with this loop
1598  det = 0;
1599  ring = 0;
1600  beam = 0;
1601  disk = 0;
1602  do {
1603  // here we got it
1604  if (detectorId.GetTECEntry(det, ring, beam, disk) == *moduleIt) {
1605  // the nominal phi value for this module
1606  const double nominalPhi = nominalCoordinates.GetTECEntry(det, ring, beam, disk).GetPhi();
1607 
1608  // the offset from the alignment parameters
1609  const double phiCorrection = endcapAlgorithm.GetAlignmentParameterCorrection(
1610  det, ring, beam, disk, nominalCoordinates, endcapParameters);
1611 
1612  // apply the corrections
1613  measuredCoordinates.GetTECEntry(det, ring, beam, disk).SetPhi(nominalPhi - phiCorrection);
1614  }
1615 
1616  } while (moduleLoop.TECLoop(det, ring, beam, disk));
1617  }
1618 }

References EcalCondDBWriter_cfi::beam, detectorId, LASEndcapAlgorithm::GetAlignmentParameterCorrection(), LASCoordinateSet::GetPhi(), LASGlobalData< T >::GetTECEntry(), moduleLoop, nominalCoordinates, relativeConstraints::ring, LASCoordinateSet::SetPhi(), LASGlobalLoop::TECLoop(), and theMaskTecModules.

Referenced by endRunProduce().

◆ beginJob()

void LaserAlignment::beginJob ( void  )
overridevirtual

Reimplemented from edm::one::EDProducerBase.

Definition at line 132 of file LaserAlignment.cc.

132  {
133  // write sumed histograms to file (if selected in cfg)
134  if (theSaveHistograms) {
135  // creating a new file
136  theFile = new TFile(theFileName.c_str(), "RECREATE", "CMS ROOT file");
137 
138  // initialize the histograms
139  if (theFile) {
140  theFile->SetCompressionLevel(theCompression);
141  singleModulesDir = theFile->mkdir("single modules");
142  } else
143  throw cms::Exception(" [LaserAlignment::beginJob]")
144  << " ** ERROR: could not open file:" << theFileName.c_str() << " for writing." << std::endl;
145  }
146 
147  // detector id maps (hard coded)
148  fillDetectorId();
149 
150  // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
151  // PROFILE, HISTOGRAM & FITFUNCTION INITIALIZATION
152  // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
153 
154  // object used to build various strings for names and labels
155  std::stringstream nameBuilder;
156 
157  // loop variables for use with LASGlobalLoop object
158  int det, ring, beam, disk, pos;
159 
160  // loop TEC modules
161  det = 0;
162  ring = 0;
163  beam = 0;
164  disk = 0;
165  do { // loop using LASGlobalLoop functionality
166  // init the profiles
170 
171  // init the hit maps
172  isAcceptedProfile.SetTECEntry(det, ring, beam, disk, 0);
174 
175  // create strings for histo names
176  nameBuilder.clear();
177  nameBuilder.str("");
178  nameBuilder << "TEC";
179  if (det == 0)
180  nameBuilder << "+";
181  else
182  nameBuilder << "-";
183  nameBuilder << "_Ring";
184  if (ring == 0)
185  nameBuilder << "4";
186  else
187  nameBuilder << "6";
188  nameBuilder << "_Beam" << beam;
189  nameBuilder << "_Disk" << disk;
190  theProfileNames.SetTECEntry(det, ring, beam, disk, nameBuilder.str());
191 
192  // init the histograms
193  if (theSaveHistograms) {
194  nameBuilder << "_Histo";
196  det, ring, beam, disk, new TH1D(nameBuilder.str().c_str(), nameBuilder.str().c_str(), 512, 0, 512));
197  summedHistograms.GetTECEntry(det, ring, beam, disk)->SetDirectory(singleModulesDir);
198  }
199 
200  } while (moduleLoop.TECLoop(det, ring, beam, disk));
201 
202  // TIB & TOB section
203  det = 2;
204  beam = 0;
205  pos = 0;
206  do { // loop using LASGlobalLoop functionality
207  // init the profiles
211 
212  // init the hit maps
215 
216  // create strings for histo names
217  nameBuilder.clear();
218  nameBuilder.str("");
219  if (det == 2)
220  nameBuilder << "TIB";
221  else
222  nameBuilder << "TOB";
223  nameBuilder << "_Beam" << beam;
224  nameBuilder << "_Zpos" << pos;
225 
226  theProfileNames.SetTIBTOBEntry(det, beam, pos, nameBuilder.str());
227 
228  // init the histograms
229  if (theSaveHistograms) {
230  nameBuilder << "_Histo";
232  det, beam, pos, new TH1D(nameBuilder.str().c_str(), nameBuilder.str().c_str(), 512, 0, 512));
234  }
235 
236  } while (moduleLoop.TIBTOBLoop(det, beam, pos));
237 
238  // TEC2TEC AT section
239  det = 0;
240  beam = 0;
241  disk = 0;
242  do { // loop using LASGlobalLoop functionality
243  // init the profiles
247 
248  // init the hit maps
249  isAcceptedProfile.SetTEC2TECEntry(det, beam, disk, 0);
251 
252  // create strings for histo names
253  nameBuilder.clear();
254  nameBuilder.str("");
255  nameBuilder << "TEC(AT)";
256  if (det == 0)
257  nameBuilder << "+";
258  else
259  nameBuilder << "-";
260  nameBuilder << "_Beam" << beam;
261  nameBuilder << "_Disk" << disk;
262  theProfileNames.SetTEC2TECEntry(det, beam, disk, nameBuilder.str());
263 
264  // init the histograms
265  if (theSaveHistograms) {
266  nameBuilder << "_Histo";
268  det, beam, disk, new TH1D(nameBuilder.str().c_str(), nameBuilder.str().c_str(), 512, 0, 512));
269  summedHistograms.GetTEC2TECEntry(det, beam, disk)->SetDirectory(singleModulesDir);
270  }
271 
272  } while (moduleLoop.TEC2TECLoop(det, beam, disk));
273 
274  firstEvent_ = true;
275 }

References EcalCondDBWriter_cfi::beam, collectedDataProfiles, currentDataProfiles, Exception, fillDetectorId(), firstEvent_, LASGlobalData< T >::GetTEC2TECEntry(), LASGlobalData< T >::GetTECEntry(), LASGlobalData< T >::GetTIBTOBEntry(), isAcceptedProfile, moduleLoop, numberOfAcceptedProfiles, pedestalProfiles, relativeConstraints::ring, LASModuleProfile::SetAllValuesTo(), LASGlobalData< T >::SetTEC2TECEntry(), LASGlobalData< T >::SetTECEntry(), LASGlobalData< T >::SetTIBTOBEntry(), singleModulesDir, summedHistograms, LASGlobalLoop::TEC2TECLoop(), LASGlobalLoop::TECLoop(), theCompression, theFile, theFileName, theProfileNames, theSaveHistograms, and LASGlobalLoop::TIBTOBLoop().

◆ CalculateNominalCoordinates()

void LaserAlignment::CalculateNominalCoordinates ( void  )
private

fills a LASGlobalData<LASCoordinateSet> with nominal module positions

Definition at line 1331 of file LaserAlignment.cc.

1331  {
1332  //
1333  // hard coded data yet...
1334  //
1335 
1336  // nominal phi values of tec beam / alignment tube hits (parameter is beam 0-7)
1337  const double tecPhiPositions[8] = {
1338  0.392699, 1.178097, 1.963495, 2.748894, 3.534292, 4.319690, 5.105088, 5.890486}; // new values calculated by maple
1339  const double atPhiPositions[8] = {
1340  0.392699, 1.289799, 1.851794, 2.748894, 3.645995, 4.319690, 5.216791, 5.778784}; // new values calculated by maple
1341 
1342  // nominal r values (mm) of hits
1343  const double tobRPosition = 600.;
1344  const double tibRPosition = 514.;
1345  const double tecRPosition[2] = {564., 840.}; // ring 4,6
1346 
1347  // nominal z values (mm) of hits in barrel (parameter is pos 0-6)
1348  const double tobZPosition[6] = {1040., 580., 220., -140., -500., -860.};
1349  const double tibZPosition[6] = {620., 380., 180., -100., -340., -540.};
1350 
1351  // nominal z values (mm) of hits in tec (parameter is disk 0-8); FOR TEC-: (* -1.)
1352  const double tecZPosition[9] = {1322.5, 1462.5, 1602.5, 1742.5, 1882.5, 2057.5, 2247.5, 2452.5, 2667.5};
1353 
1354  //
1355  // now we fill these into the nominalCoordinates container;
1356  // errors are zero for nominal values..
1357  //
1358 
1359  // loop object and its variables
1361  int det, ring, beam, disk, pos;
1362 
1363  // TEC+- section
1364  det = 0;
1365  ring = 0, beam = 0;
1366  disk = 0;
1367  do {
1368  if (det == 0) { // this is TEC+
1370  det,
1371  ring,
1372  beam,
1373  disk,
1374  LASCoordinateSet(tecPhiPositions[beam], 0., tecRPosition[ring], 0., tecZPosition[disk], 0.));
1375  } else { // now TEC-
1377  det,
1378  ring,
1379  beam,
1380  disk,
1382  tecPhiPositions[beam], 0., tecRPosition[ring], 0., -1. * tecZPosition[disk], 0.)); // just * -1.
1383  }
1384 
1385  } while (moduleLoop.TECLoop(det, ring, beam, disk));
1386 
1387  // TIB & TOB section
1388  det = 2;
1389  beam = 0;
1390  pos = 0;
1391  do {
1392  if (det == 2) { // this is TIB
1394  det, beam, pos, LASCoordinateSet(atPhiPositions[beam], 0., tibRPosition, 0., tibZPosition[pos], 0.));
1395  } else { // now TOB
1397  det, beam, pos, LASCoordinateSet(atPhiPositions[beam], 0., tobRPosition, 0., tobZPosition[pos], 0.));
1398  }
1399 
1400  } while (moduleLoop.TIBTOBLoop(det, beam, pos));
1401 
1402  // TEC2TEC AT section
1403  det = 0;
1404  beam = 0;
1405  disk = 0;
1406  do {
1407  if (det == 0) { // this is TEC+, ring4 only
1409  det, beam, disk, LASCoordinateSet(atPhiPositions[beam], 0., tecRPosition[0], 0., tecZPosition[disk], 0.));
1410  } else { // now TEC-
1412  det,
1413  beam,
1414  disk,
1415  LASCoordinateSet(atPhiPositions[beam], 0., tecRPosition[0], 0., -1. * tecZPosition[disk], 0.)); // just * -1.
1416  }
1417 
1418  } while (moduleLoop.TEC2TECLoop(det, beam, disk));
1419 }

References EcalCondDBWriter_cfi::beam, moduleLoop, nominalCoordinates, relativeConstraints::ring, LASGlobalData< T >::SetTEC2TECEntry(), LASGlobalData< T >::SetTECEntry(), LASGlobalData< T >::SetTIBTOBEntry(), LASGlobalLoop::TEC2TECLoop(), LASGlobalLoop::TECLoop(), and LASGlobalLoop::TIBTOBLoop().

Referenced by endRunProduce().

◆ ConvertAngle()

double LaserAlignment::ConvertAngle ( double  angle)
private

convert an angle in the [-pi,pi] range to the [0,2*pi] range

convert an angle in the [-pi,pi] range to the [0,2*pi] range

Definition at line 1425 of file LaserAlignment.cc.

1425  {
1426  if (angle < -1. * M_PI || angle > M_PI) {
1427  throw cms::Exception(" [LaserAlignment::ConvertAngle] ")
1428  << "** ERROR: Called with illegal input angle: " << angle << "." << std::endl;
1429  }
1430 
1431  if (angle >= 0.)
1432  return angle;
1433  else
1434  return (angle + 2. * M_PI);
1435 }

References angle(), Exception, and M_PI.

Referenced by endRunProduce().

◆ DumpHitmaps()

void LaserAlignment::DumpHitmaps ( LASGlobalData< int > &  numberOfAcceptedProfiles)
private

for debugging only, will disappear

Definition at line 1530 of file LaserAlignment.cc.

1530  {
1531  std::cout << " [LaserAlignment::DumpHitmaps] -- Dumping hitmap for TEC+:" << std::endl;
1532  std::cout << " [LaserAlignment::DumpHitmaps] -- Ring4:" << std::endl;
1533  std::cout << " disk0 disk1 disk2 disk3 disk4 disk5 disk6 disk7 disk8" << std::endl;
1534 
1535  for (int beam = 0; beam < 8; ++beam) {
1536  std::cout << " beam" << beam << ":";
1537  for (int disk = 0; disk < 9; ++disk) {
1538  std::cout << "\t" << numberOfAcceptedProfiles.GetTECEntry(0, 0, beam, disk);
1539  }
1540  std::cout << std::endl;
1541  }
1542 
1543  std::cout << " [LaserAlignment::DumpHitmaps] -- Ring6:" << std::endl;
1544  std::cout << " disk0 disk1 disk2 disk3 disk4 disk5 disk6 disk7 disk8" << std::endl;
1545 
1546  for (int beam = 0; beam < 8; ++beam) {
1547  std::cout << " beam" << beam << ":";
1548  for (int disk = 0; disk < 9; ++disk) {
1549  std::cout << "\t" << numberOfAcceptedProfiles.GetTECEntry(0, 1, beam, disk);
1550  }
1551  std::cout << std::endl;
1552  }
1553 
1554  std::cout << " [LaserAlignment::DumpHitmaps] -- Dumping hitmap for TEC-:" << std::endl;
1555  std::cout << " [LaserAlignment::DumpHitmaps] -- Ring4:" << std::endl;
1556  std::cout << " disk0 disk1 disk2 disk3 disk4 disk5 disk6 disk7 disk8" << std::endl;
1557 
1558  for (int beam = 0; beam < 8; ++beam) {
1559  std::cout << " beam" << beam << ":";
1560  for (int disk = 0; disk < 9; ++disk) {
1561  std::cout << "\t" << numberOfAcceptedProfiles.GetTECEntry(1, 0, beam, disk);
1562  }
1563  std::cout << std::endl;
1564  }
1565 
1566  std::cout << " [LaserAlignment::DumpHitmaps] -- Ring6:" << std::endl;
1567  std::cout << " disk0 disk1 disk2 disk3 disk4 disk5 disk6 disk7 disk8" << std::endl;
1568 
1569  for (int beam = 0; beam < 8; ++beam) {
1570  std::cout << " beam" << beam << ":";
1571  for (int disk = 0; disk < 9; ++disk) {
1572  std::cout << "\t" << numberOfAcceptedProfiles.GetTECEntry(1, 1, beam, disk);
1573  }
1574  std::cout << std::endl;
1575  }
1576 
1577  std::cout << " [LaserAlignment::DumpHitmaps] -- End of dump." << std::endl << std::endl;
1578 }

References EcalCondDBWriter_cfi::beam, gather_cfg::cout, LASGlobalData< T >::GetTECEntry(), and numberOfAcceptedProfiles.

Referenced by endRunProduce().

◆ DumpPosFileSet()

void LaserAlignment::DumpPosFileSet ( LASGlobalData< LASCoordinateSet > &  coordinates)
private

for debugging only, will disappear

debug only, will disappear

Definition at line 1440 of file LaserAlignment.cc.

1440  {
1442  int det, ring, beam, disk, pos;
1443 
1444  std::cout << std::endl << " [LaserAlignment::DumpPosFileSet] -- Dump: " << std::endl;
1445 
1446  // TEC INTERNAL
1447  det = 0;
1448  ring = 0;
1449  beam = 0;
1450  disk = 0;
1451  do {
1452  std::cout << "POS " << det << "\t" << beam << "\t" << disk << "\t" << ring << "\t"
1453  << coordinates.GetTECEntry(det, ring, beam, disk).GetPhi() << "\t"
1454  << coordinates.GetTECEntry(det, ring, beam, disk).GetPhiError() << std::endl;
1455  } while (loop.TECLoop(det, ring, beam, disk));
1456 
1457  // TIBTOB
1458  det = 2;
1459  beam = 0;
1460  pos = 0;
1461  do {
1462  std::cout << "POS " << det << "\t" << beam << "\t" << pos << "\t"
1463  << "-1"
1464  << "\t" << coordinates.GetTIBTOBEntry(det, beam, pos).GetPhi() << "\t"
1465  << coordinates.GetTIBTOBEntry(det, beam, pos).GetPhiError() << std::endl;
1466  } while (loop.TIBTOBLoop(det, beam, pos));
1467 
1468  // TEC2TEC
1469  det = 0;
1470  beam = 0;
1471  disk = 0;
1472  do {
1473  std::cout << "POS " << det << "\t" << beam << "\t" << disk << "\t"
1474  << "-1"
1475  << "\t" << coordinates.GetTEC2TECEntry(det, beam, disk).GetPhi() << "\t"
1476  << coordinates.GetTEC2TECEntry(det, beam, disk).GetPhiError() << std::endl;
1477  } while (loop.TEC2TECLoop(det, beam, disk));
1478 
1479  std::cout << std::endl << " [LaserAlignment::DumpPosFileSet] -- End dump: " << std::endl;
1480 }

References EcalCondDBWriter_cfi::beam, gather_cfg::cout, LASCoordinateSet::GetPhi(), LASCoordinateSet::GetPhiError(), LASGlobalData< T >::GetTEC2TECEntry(), LASGlobalData< T >::GetTECEntry(), LASGlobalData< T >::GetTIBTOBEntry(), heppy_loop::loop, and relativeConstraints::ring.

◆ DumpStripFileSet()

void LaserAlignment::DumpStripFileSet ( LASGlobalData< std::pair< float, float > > &  measuredStripPositions)
private

for debugging only, will disappear

Definition at line 1485 of file LaserAlignment.cc.

1485  {
1487  int det, ring, beam, disk, pos;
1488 
1489  std::cout << std::endl << " [LaserAlignment::DumpStripFileSet] -- Dump: " << std::endl;
1490 
1491  // TEC INTERNAL
1492  det = 0;
1493  ring = 0;
1494  beam = 0;
1495  disk = 0;
1496  do {
1497  std::cout << "STRIP " << det << "\t" << beam << "\t" << disk << "\t" << ring << "\t"
1498  << measuredStripPositions.GetTECEntry(det, ring, beam, disk).first << "\t"
1499  << measuredStripPositions.GetTECEntry(det, ring, beam, disk).second << std::endl;
1500  } while (loop.TECLoop(det, ring, beam, disk));
1501 
1502  // TIBTOB
1503  det = 2;
1504  beam = 0;
1505  pos = 0;
1506  do {
1507  std::cout << "STRIP " << det << "\t" << beam << "\t" << pos << "\t"
1508  << "-1"
1509  << "\t" << measuredStripPositions.GetTIBTOBEntry(det, beam, pos).first << "\t"
1510  << measuredStripPositions.GetTIBTOBEntry(det, beam, pos).second << std::endl;
1511  } while (loop.TIBTOBLoop(det, beam, pos));
1512 
1513  // TEC2TEC
1514  det = 0;
1515  beam = 0;
1516  disk = 0;
1517  do {
1518  std::cout << "STRIP " << det << "\t" << beam << "\t" << disk << "\t"
1519  << "-1"
1520  << "\t" << measuredStripPositions.GetTEC2TECEntry(det, beam, disk).first << "\t"
1521  << measuredStripPositions.GetTEC2TECEntry(det, beam, disk).second << std::endl;
1522  } while (loop.TEC2TECLoop(det, beam, disk));
1523 
1524  std::cout << std::endl << " [LaserAlignment::DumpStripFileSet] -- End dump: " << std::endl;
1525 }

References EcalCondDBWriter_cfi::beam, gather_cfg::cout, heppy_loop::loop, and relativeConstraints::ring.

◆ endJob()

void LaserAlignment::endJob ( void  )
overridevirtual

Reimplemented from edm::one::EDProducerBase.

Definition at line 934 of file LaserAlignment.cc.

934 {}

Referenced by o2olib.O2ORunMgr::executeJob().

◆ endRunProduce()

void LaserAlignment::endRunProduce ( edm::Run theRun,
const edm::EventSetup theSetup 
)
override

laser hit section for trackbased interface

due to the peculiar order of beams in TkLasBeamCollection, we cannot use the LASGlobalLoop object here

Definition at line 489 of file LaserAlignment.cc.

489  {
490  std::cout << " [LaserAlignment::endRun] -- Total number of events processed: " << theEvents << std::endl;
491 
492  // for debugging only..
494 
495  // index variables for the LASGlobalLoop objects
496  int det, ring, beam, disk, pos;
497 
498  // measured positions container for the algorithms
499  LASGlobalData<LASCoordinateSet> measuredCoordinates;
500 
501  // fitted peak positions in units of strips (pair for value,error)
502  LASGlobalData<std::pair<float, float> > measuredStripPositions;
503 
504  // the peak finder, a pair (pos/posErr in units of strips) for its results, and the success confirmation
505  LASPeakFinder peakFinder;
507  std::pair<double, double> peakFinderResults;
508  bool isGoodFit;
509 
510  // tracker geom. object for calculating the global beam positions
511  const TrackerGeometry& theTracker(*theTrackerGeometry);
512 
513  // fill LASGlobalData<LASCoordinateSet> nominalCoordinates
515 
516  // for determining the phi errors
517  // ErrorFrameTransformer errorTransformer; // later...
518 
519  // do the fits for TEC+- internal
520  det = 0;
521  ring = 0;
522  beam = 0;
523  disk = 0;
524  do {
525  // do the fit
526  isGoodFit = peakFinder.FindPeakIn(collectedDataProfiles.GetTECEntry(det, ring, beam, disk),
527  peakFinderResults,
528  summedHistograms.GetTECEntry(det, ring, beam, disk),
529  0); // offset is 0 for TEC
530 
531  // now we have the measured positions in units of strips.
532  if (!isGoodFit)
533  std::cout << " [LaserAlignment::endRun] ** WARNING: Fit failed for TEC det: " << det << ", ring: " << ring
534  << ", beam: " << beam << ", disk: " << disk << " (id: " << detectorId.GetTECEntry(det, ring, beam, disk)
535  << ")." << std::endl;
536 
537  // <- here we will later implement the kink corrections
538 
539  // access the tracker geometry for this module
540  const DetId theDetId(detectorId.GetTECEntry(det, ring, beam, disk));
541  const StripGeomDetUnit* const theStripDet = dynamic_cast<const StripGeomDetUnit*>(theTracker.idToDet(theDetId));
542 
543  if (theStripDet) {
544  // first, set the measured coordinates to their nominal values
545  measuredCoordinates.SetTECEntry(det, ring, beam, disk, nominalCoordinates.GetTECEntry(det, ring, beam, disk));
546 
547  if (isGoodFit) { // convert strip position to global phi and replace the nominal phi value/error
548 
549  measuredStripPositions.GetTECEntry(det, ring, beam, disk) = peakFinderResults;
550  const float positionInStrips =
552  ? 256.
553  : peakFinderResults.first; // implementation of "ForceFitterToNominalStrips" config parameter
554  const GlobalPoint& globalPoint =
555  theStripDet->surface().toGlobal(theStripDet->specificTopology().localPosition(positionInStrips));
556  measuredCoordinates.GetTECEntry(det, ring, beam, disk).SetPhi(ConvertAngle(globalPoint.barePhi()));
557 
558  // const GlobalError& globalError = errorTransformer.transform( theStripDet->specificTopology().localError( peakFinderResults.first, pow( peakFinderResults.second, 2 ) ), theStripDet->surface() );
559  // measuredCoordinates.GetTECEntry( det, ring, beam, disk ).SetPhiError( globalError.phierr( globalPoint ) );
560  measuredCoordinates.GetTECEntry(det, ring, beam, disk).SetPhiError(0.00046); // PRELIMINARY ESTIMATE
561 
562  } else { // keep nominal position (middle-of-module) but set a giant phi error so that the module can be ignored by the alignment algorithm
563  measuredStripPositions.GetTECEntry(det, ring, beam, disk) = std::pair<float, float>(256., 1000.);
564  const GlobalPoint& globalPoint =
565  theStripDet->surface().toGlobal(theStripDet->specificTopology().localPosition(256.));
566  measuredCoordinates.GetTECEntry(det, ring, beam, disk).SetPhi(ConvertAngle(globalPoint.barePhi()));
567  measuredCoordinates.GetTECEntry(det, ring, beam, disk).SetPhiError(1000.);
568  }
569  }
570 
571  } while (moduleLoop.TECLoop(det, ring, beam, disk));
572 
573  // do the fits for TIB/TOB
574  det = 2;
575  beam = 0;
576  pos = 0;
577  do {
578  // do the fit
579  isGoodFit = peakFinder.FindPeakIn(collectedDataProfiles.GetTIBTOBEntry(det, beam, pos),
580  peakFinderResults,
583 
584  // now we have the measured positions in units of strips.
585  if (!isGoodFit)
586  std::cout << " [LaserAlignment::endJob] ** WARNING: Fit failed for TIB/TOB det: " << det << ", beam: " << beam
587  << ", pos: " << pos << " (id: " << detectorId.GetTIBTOBEntry(det, beam, pos) << ")." << std::endl;
588 
589  // <- here we will later implement the kink corrections
590 
591  // access the tracker geometry for this module
592  const DetId theDetId(detectorId.GetTIBTOBEntry(det, beam, pos));
593  const StripGeomDetUnit* const theStripDet = dynamic_cast<const StripGeomDetUnit*>(theTracker.idToDet(theDetId));
594 
595  if (theStripDet) {
596  // first, set the measured coordinates to their nominal values
597  measuredCoordinates.SetTIBTOBEntry(det, beam, pos, nominalCoordinates.GetTIBTOBEntry(det, beam, pos));
598 
599  if (isGoodFit) { // convert strip position to global phi and replace the nominal phi value/error
600  measuredStripPositions.GetTIBTOBEntry(det, beam, pos) = peakFinderResults;
601  const float positionInStrips =
603  ? 256. + getTIBTOBNominalBeamOffset(det, beam, pos)
604  : peakFinderResults.first; // implementation of "ForceFitterToNominalStrips" config parameter
605  const GlobalPoint& globalPoint =
606  theStripDet->surface().toGlobal(theStripDet->specificTopology().localPosition(positionInStrips));
607  measuredCoordinates.GetTIBTOBEntry(det, beam, pos).SetPhi(ConvertAngle(globalPoint.barePhi()));
608  measuredCoordinates.GetTIBTOBEntry(det, beam, pos).SetPhiError(0.00028); // PRELIMINARY ESTIMATE
609  } else { // keep nominal position but set a giant phi error so that the module can be ignored by the alignment algorithm
610  measuredStripPositions.GetTIBTOBEntry(det, beam, pos) =
611  std::pair<float, float>(256. + getTIBTOBNominalBeamOffset(det, beam, pos), 1000.);
612  const GlobalPoint& globalPoint = theStripDet->surface().toGlobal(
613  theStripDet->specificTopology().localPosition(256. + getTIBTOBNominalBeamOffset(det, beam, pos)));
614  measuredCoordinates.GetTIBTOBEntry(det, beam, pos).SetPhi(ConvertAngle(globalPoint.barePhi()));
615  measuredCoordinates.GetTIBTOBEntry(det, beam, pos).SetPhiError(1000.);
616  }
617  }
618 
619  } while (moduleLoop.TIBTOBLoop(det, beam, pos));
620 
621  // do the fits for TEC AT
622  det = 0;
623  beam = 0;
624  disk = 0;
625  do {
626  // do the fit
627  isGoodFit = peakFinder.FindPeakIn(collectedDataProfiles.GetTEC2TECEntry(det, beam, disk),
628  peakFinderResults,
630  getTEC2TECNominalBeamOffset(det, beam, disk));
631  // now we have the positions in units of strips.
632  if (!isGoodFit)
633  std::cout << " [LaserAlignment::endRun] ** WARNING: Fit failed for TEC2TEC det: " << det << ", beam: " << beam
634  << ", disk: " << disk << " (id: " << detectorId.GetTEC2TECEntry(det, beam, disk) << ")." << std::endl;
635 
636  // <- here we will later implement the kink corrections
637 
638  // access the tracker geometry for this module
639  const DetId theDetId(detectorId.GetTEC2TECEntry(det, beam, disk));
640  const StripGeomDetUnit* const theStripDet = dynamic_cast<const StripGeomDetUnit*>(theTracker.idToDet(theDetId));
641 
642  if (theStripDet) {
643  // first, set the measured coordinates to their nominal values
644  measuredCoordinates.SetTEC2TECEntry(det, beam, disk, nominalCoordinates.GetTEC2TECEntry(det, beam, disk));
645 
646  if (isGoodFit) { // convert strip position to global phi and replace the nominal phi value/error
647  measuredStripPositions.GetTEC2TECEntry(det, beam, disk) = peakFinderResults;
648  const float positionInStrips =
650  ? 256. + getTEC2TECNominalBeamOffset(det, beam, disk)
651  : peakFinderResults.first; // implementation of "ForceFitterToNominalStrips" config parameter
652  const GlobalPoint& globalPoint =
653  theStripDet->surface().toGlobal(theStripDet->specificTopology().localPosition(positionInStrips));
654  measuredCoordinates.GetTEC2TECEntry(det, beam, disk).SetPhi(ConvertAngle(globalPoint.barePhi()));
655  measuredCoordinates.GetTEC2TECEntry(det, beam, disk).SetPhiError(0.00047); // PRELIMINARY ESTIMATE
656  } else { // keep nominal position but set a giant phi error so that the module can be ignored by the alignment algorithm
657  measuredStripPositions.GetTEC2TECEntry(det, beam, disk) =
658  std::pair<float, float>(256. + getTEC2TECNominalBeamOffset(det, beam, disk), 1000.);
659  const GlobalPoint& globalPoint = theStripDet->surface().toGlobal(
660  theStripDet->specificTopology().localPosition(256. + getTEC2TECNominalBeamOffset(det, beam, disk)));
661  measuredCoordinates.GetTEC2TECEntry(det, beam, disk).SetPhi(ConvertAngle(globalPoint.barePhi()));
662  measuredCoordinates.GetTEC2TECEntry(det, beam, disk).SetPhiError(1000.);
663  }
664  }
665 
666  } while (moduleLoop.TEC2TECLoop(det, beam, disk));
667 
668  // see what we got (for debugging)
669  // DumpStripFileSet( measuredStripPositions );
670  // DumpPosFileSet( measuredCoordinates );
671 
672  // CALCULATE PARAMETERS AND UPDATE DB OBJECT
673  // for beam kink corrections, reconstructing the geometry and updating the db object
675 
676  // apply all beam corrections
678  geometryUpdater.ApplyBeamKinkCorrections(measuredCoordinates);
679 
680  // if we start with input geometry instead of IDEAL,
681  // reverse the adjustments in the AlignableTracker object
683  geometryUpdater.SetReverseDirection(true);
684 
685  // if we have "virtual" misalignment which is introduced via the reference geometry,
686  // tell the LASGeometryUpdater to reverse x & y adjustments
688  geometryUpdater.SetMisalignmentFromRefGeometry(true);
689 
690  // run the endcap algorithm
691  LASEndcapAlgorithm endcapAlgorithm;
692  LASEndcapAlignmentParameterSet endcapParameters;
693 
694  // this basically sets all the endcap modules to be masked
695  // to their nominal positions (since endcapParameters is overall zero)
696  if (!theMaskTecModules.empty()) {
697  ApplyEndcapMaskingCorrections(measuredCoordinates, nominalCoordinates, endcapParameters);
698  }
699 
700  // run the algorithm
701  endcapParameters = endcapAlgorithm.CalculateParameters(measuredCoordinates, nominalCoordinates);
702 
703  //
704  // loop to mask out events
705  // DESCRIPTION:
706  //
707 
708  // do this only if there are modules to be masked..
709  if (!theMaskTecModules.empty()) {
710  const unsigned int nIterations = 30;
711  for (unsigned int iteration = 0; iteration < nIterations; ++iteration) {
712  // set the endcap modules to be masked to their positions
713  // according to the reconstructed parameters
714  ApplyEndcapMaskingCorrections(measuredCoordinates, nominalCoordinates, endcapParameters);
715 
716  // modifications applied, so re-run the algorithm
717  endcapParameters = endcapAlgorithm.CalculateParameters(measuredCoordinates, nominalCoordinates);
718  }
719  }
720 
721  // these are now final, so:
722  endcapParameters.Print();
723 
724  // do a pre-alignment of the endcaps (TEC2TEC only)
725  // so that the alignment tube algorithms finds orderly disks
726  geometryUpdater.EndcapUpdate(endcapParameters, measuredCoordinates);
727 
728  // the alignment tube algorithms, choose from config
729  LASBarrelAlignmentParameterSet alignmentTubeParameters;
730  // the MINUIT-BASED alignment tube algorithm
731  LASBarrelAlgorithm barrelAlgorithm;
732  // the ANALYTICAL alignment tube algorithm
733  LASAlignmentTubeAlgorithm alignmentTubeAlgorithm;
734 
735  // this basically sets all the modules to be masked
736  // to their nominal positions (since alignmentTubeParameters is overall zero)
737  if (!theMaskAtModules.empty()) {
738  ApplyATMaskingCorrections(measuredCoordinates, nominalCoordinates, alignmentTubeParameters);
739  }
740 
741  if (theUseMinuitAlgorithm) {
742  // run the MINUIT-BASED alignment tube algorithm
743  alignmentTubeParameters = barrelAlgorithm.CalculateParameters(measuredCoordinates, nominalCoordinates);
744  } else {
745  // the ANALYTICAL alignment tube algorithm
746  alignmentTubeParameters = alignmentTubeAlgorithm.CalculateParameters(measuredCoordinates, nominalCoordinates);
747  }
748 
749  //
750  // loop to mask out events
751  // DESCRIPTION:
752  //
753 
754  // do this only if there are modules to be masked..
755  if (!theMaskAtModules.empty()) {
756  const unsigned int nIterations = 30;
757  for (unsigned int iteration = 0; iteration < nIterations; ++iteration) {
758  // set the AT modules to be masked to their positions
759  // according to the reconstructed parameters
760  ApplyATMaskingCorrections(measuredCoordinates, nominalCoordinates, alignmentTubeParameters);
761 
762  // modifications applied, so re-run the algorithm
763  if (theUseMinuitAlgorithm) {
764  alignmentTubeParameters = barrelAlgorithm.CalculateParameters(measuredCoordinates, nominalCoordinates);
765  } else {
766  alignmentTubeParameters = alignmentTubeAlgorithm.CalculateParameters(measuredCoordinates, nominalCoordinates);
767  }
768  }
769  }
770 
771  // these are now final, so:
772  alignmentTubeParameters.Print();
773 
774  // combine the results and update the db object
775  geometryUpdater.TrackerUpdate(endcapParameters, alignmentTubeParameters, *theAlignableTracker);
776 
781 
782  // the collection container
783  auto laserBeams = std::make_unique<TkLasBeamCollection>();
784 
785  // first for the endcap internal beams
786  for (det = 0; det < 2; ++det) {
787  for (ring = 0; ring < 2; ++ring) {
788  for (beam = 0; beam < 8; ++beam) {
789  // the beam and its identifier (see TkLasTrackBasedInterface TWiki)
790  TkLasBeam currentBeam(100 * det + 10 * beam + ring);
791 
792  // order the hits in the beam by increasing z
793  const int firstDisk = det == 0 ? 0 : 8;
794  const int lastDisk = det == 0 ? 8 : 0;
795 
796  // count upwards or downwards
797  for (disk = firstDisk; det == 0 ? disk <= lastDisk : disk >= lastDisk; det == 0 ? ++disk : --disk) {
798  // detId for the SiStripLaserRecHit2D
799  const SiStripDetId theDetId(detectorId.GetTECEntry(det, ring, beam, disk));
800 
801  // need this to calculate the localPosition and its error
802  const StripGeomDetUnit* const theStripDet =
803  dynamic_cast<const StripGeomDetUnit*>(theTracker.idToDet(theDetId));
804 
805  // the hit container
806  const SiStripLaserRecHit2D currentHit(theStripDet->specificTopology().localPosition(
807  measuredStripPositions.GetTECEntry(det, ring, beam, disk).first),
808  theStripDet->specificTopology().localError(
809  measuredStripPositions.GetTECEntry(det, ring, beam, disk).first,
810  measuredStripPositions.GetTECEntry(det, ring, beam, disk).second),
811  theDetId);
812 
813  currentBeam.push_back(currentHit);
814  }
815 
816  laserBeams->push_back(currentBeam);
817  }
818  }
819  }
820 
821  // then, following the convention in TkLasTrackBasedInterface TWiki, the alignment tube beams;
822  // they comprise hits in TIBTOB & TEC2TEC
823 
824  for (beam = 0; beam < 8; ++beam) {
825  // the beam and its identifier (see TkLasTrackBasedInterface TWiki)
826  TkLasBeam currentBeam(100 * 2 /*beamGroup=AT=2*/ + 10 * beam + 0 /*ring=0*/);
827 
828  // first: tec-
829  det = 1;
830  for (disk = 4; disk >= 0; --disk) {
831  // detId for the SiStripLaserRecHit2D
832  const SiStripDetId theDetId(detectorId.GetTEC2TECEntry(det, beam, disk));
833 
834  // need this to calculate the localPosition and its error
835  const StripGeomDetUnit* const theStripDet = dynamic_cast<const StripGeomDetUnit*>(theTracker.idToDet(theDetId));
836 
837  // the hit container
838  const SiStripLaserRecHit2D currentHit(
839  theStripDet->specificTopology().localPosition(measuredStripPositions.GetTEC2TECEntry(det, beam, disk).first),
840  theStripDet->specificTopology().localError(measuredStripPositions.GetTEC2TECEntry(det, beam, disk).first,
841  measuredStripPositions.GetTEC2TECEntry(det, beam, disk).second),
842  theDetId);
843 
844  currentBeam.push_back(currentHit);
845  }
846 
847  // now TIB and TOB in one go
848  for (det = 2; det < 4; ++det) {
849  for (pos = 5; pos >= 0; --pos) { // stupidly, pos is defined from +z to -z in LASGlobalLoop
850 
851  // detId for the SiStripLaserRecHit2D
852  const SiStripDetId theDetId(detectorId.GetTIBTOBEntry(det, beam, pos));
853 
854  // need this to calculate the localPosition and its error
855  const StripGeomDetUnit* const theStripDet = dynamic_cast<const StripGeomDetUnit*>(theTracker.idToDet(theDetId));
856 
857  // the hit container
858  const SiStripLaserRecHit2D currentHit(
859  theStripDet->specificTopology().localPosition(measuredStripPositions.GetTIBTOBEntry(det, beam, pos).first),
860  theStripDet->specificTopology().localError(measuredStripPositions.GetTIBTOBEntry(det, beam, pos).first,
861  measuredStripPositions.GetTIBTOBEntry(det, beam, pos).second),
862  theDetId);
863 
864  currentBeam.push_back(currentHit);
865  }
866  }
867 
868  // then: tec+
869  det = 0;
870  for (disk = 0; disk < 5; ++disk) {
871  // detId for the SiStripLaserRecHit2D
872  const SiStripDetId theDetId(detectorId.GetTEC2TECEntry(det, beam, disk));
873 
874  // need this to calculate the localPosition and its error
875  const StripGeomDetUnit* const theStripDet = dynamic_cast<const StripGeomDetUnit*>(theTracker.idToDet(theDetId));
876 
877  // the hit container
878  const SiStripLaserRecHit2D currentHit(
879  theStripDet->specificTopology().localPosition(measuredStripPositions.GetTEC2TECEntry(det, beam, disk).first),
880  theStripDet->specificTopology().localError(measuredStripPositions.GetTEC2TECEntry(det, beam, disk).first,
881  measuredStripPositions.GetTEC2TECEntry(det, beam, disk).second),
882  theDetId);
883 
884  currentBeam.push_back(currentHit);
885  }
886 
887  // save this beam to the beamCollection
888  laserBeams->push_back(currentBeam);
889 
890  } // (close beam loop)
891 
892  // now attach the collection to the run
893  theRun.put(std::move(laserBeams), "tkLaserBeams");
894 
895  // store the estimated alignment parameters into the DB
896  // first get them
897  Alignments* alignments = theAlignableTracker->alignments();
899 
900  if (theStoreToDB) {
901  std::cout << " [LaserAlignment::endRun] -- Storing the calculated alignment parameters to the DataBase:"
902  << std::endl;
903 
904  // Call service
906  if (!poolDbService.isAvailable()) // Die if not available
907  throw cms::Exception("NotAvailable") << "PoolDBOutputService not available";
908 
909  // Store
910 
911  // if ( poolDbService->isNewTagRequest(theAlignRecordName) ) {
912  // poolDbService->createNewIOV<Alignments>( alignments, poolDbService->currentTime(), poolDbService->endOfTime(), theAlignRecordName );
913  // }
914  // else {
915  // poolDbService->appendSinceTime<Alignments>( alignments, poolDbService->currentTime(), theAlignRecordName );
916  // }
917  poolDbService->writeOne<Alignments>(alignments, poolDbService->beginOfTime(), theAlignRecordName);
918 
919  // if ( poolDbService->isNewTagRequest(theErrorRecordName) ) {
920  // poolDbService->createNewIOV<AlignmentErrorsExtended>( alignmentErrors, poolDbService->currentTime(), poolDbService->endOfTime(), theErrorRecordName );
921  // }
922  // else {
923  // poolDbService->appendSinceTime<AlignmentErrorsExtended>( alignmentErrors, poolDbService->currentTime(), theErrorRecordName );
924  // }
925  poolDbService->writeOne<AlignmentErrorsExtended>(alignmentErrors, poolDbService->beginOfTime(), theErrorRecordName);
926 
927  std::cout << " [LaserAlignment::endRun] -- Storing done." << std::endl;
928  }
929 }

References AlignableTracker::alignmentErrors(), AlignableTracker::alignments(), ApplyATMaskingCorrections(), LASGeometryUpdater::ApplyBeamKinkCorrections(), ApplyEndcapMaskingCorrections(), PV3DBase< T, PVType, FrameType >::barePhi(), EcalCondDBWriter_cfi::beam, cond::service::PoolDBOutputService::beginOfTime(), CalculateNominalCoordinates(), LASAlignmentTubeAlgorithm::CalculateParameters(), LASBarrelAlgorithm::CalculateParameters(), LASEndcapAlgorithm::CalculateParameters(), collectedDataProfiles, ConvertAngle(), gather_cfg::cout, detectorId, DumpHitmaps(), LASGeometryUpdater::EndcapUpdate(), LASPeakFinder::FindPeakIn(), LASGlobalData< T >::GetTEC2TECEntry(), getTEC2TECNominalBeamOffset(), LASGlobalData< T >::GetTECEntry(), LASGlobalData< T >::GetTIBTOBEntry(), getTIBTOBNominalBeamOffset(), TrackerGeometry::idToDet(), edm::Service< T >::isAvailable(), align_cfg::iteration, misalignedByRefGeometry, moduleLoop, eostools::move(), nominalCoordinates, numberOfAcceptedProfiles, peakFinderThreshold, LASBarrelAlignmentParameterSet::Print(), LASEndcapAlignmentParameterSet::Print(), TkLasBeam::push_back(), edm::Run::put(), relativeConstraints::ring, LASPeakFinder::SetAmplitudeThreshold(), LASGeometryUpdater::SetMisalignmentFromRefGeometry(), LASCoordinateSet::SetPhi(), LASCoordinateSet::SetPhiError(), LASGeometryUpdater::SetReverseDirection(), LASGlobalData< T >::SetTEC2TECEntry(), LASGlobalData< T >::SetTECEntry(), LASGlobalData< T >::SetTIBTOBEntry(), summedHistograms, LASGlobalLoop::TEC2TECLoop(), LASGlobalLoop::TECLoop(), theAlignableTracker, theAlignRecordName, theApplyBeamKinkCorrections, theErrorRecordName, theEvents, theLasConstants, theMaskAtModules, theMaskTecModules, theSetNominalStrips, theStoreToDB, theTrackerGeometry, theUseMinuitAlgorithm, LASGlobalLoop::TIBTOBLoop(), LASGeometryUpdater::TrackerUpdate(), updateFromInputGeometry, and cond::service::PoolDBOutputService::writeOne().

◆ fillDataProfiles()

void LaserAlignment::fillDataProfiles ( edm::Event const &  theEvent,
edm::EventSetup const &  theSetup 
)
private

fill profiles from SiStrip(Raw)Digi container

fills the module profiles (LASGlobalLoop<LASModuleProfile> currentDataProfiles) from the event digi containers, distinguishing between SiStripDigi or SiStripRawDigi.

Definition at line 940 of file LaserAlignment.cc.

940  {
941  // two handles for the two different kinds of digis
944 
945  bool isRawDigi = false;
946 
947  // indices for the LASGlobalLoop object
948  int det = 0, ring = 0, beam = 0, disk = 0, pos = 0;
949 
950  // query config set and loop over all PSets in the VPSet
951  for (std::vector<edm::ParameterSet>::iterator itDigiProducersList = theDigiProducersList.begin();
952  itDigiProducersList != theDigiProducersList.end();
953  ++itDigiProducersList) {
954  std::string digiProducer = itDigiProducersList->getParameter<std::string>("DigiProducer");
955  std::string digiLabel = itDigiProducersList->getParameter<std::string>("DigiLabel");
956  std::string digiType = itDigiProducersList->getParameter<std::string>("DigiType");
957 
958  // now branch according to digi type (raw or processed);
959  // first we go for raw digis => SiStripRawDigi
960  if (digiType == "Raw") {
961  theEvent.getByLabel(digiProducer, digiLabel, theStripRawDigis);
962  isRawDigi = true;
963  } else if (digiType == "Processed") {
964  theEvent.getByLabel(digiProducer, digiLabel, theStripDigis);
965  isRawDigi = false;
966  } else {
967  throw cms::Exception(" [LaserAlignment::fillDataProfiles]")
968  << " ** ERROR: Invalid digi type: \"" << digiType << "\" specified in configuration." << std::endl;
969  }
970 
971  // loop TEC internal modules
972  det = 0;
973  ring = 0;
974  beam = 0;
975  disk = 0;
976  do {
977  // first clear the profile
979 
980  // retrieve the raw id of that module
981  const int detRawId = detectorId.GetTECEntry(det, ring, beam, disk);
982 
983  if (isRawDigi) { // we have raw SiStripRawDigis
984 
985  // search the digis for the raw id
986  edm::DetSetVector<SiStripRawDigi>::const_iterator detSetIter = theStripRawDigis->find(detRawId);
987  if (detSetIter == theStripRawDigis->end()) {
988  throw cms::Exception("[Laser Alignment::fillDataProfiles]")
989  << " ** ERROR: No raw DetSet found for det: " << detRawId << "." << std::endl;
990  }
991 
992  // fill the digis to the profiles
993  edm::DetSet<SiStripRawDigi>::const_iterator digiRangeIterator = detSetIter->data.begin(); // for the loop
994  edm::DetSet<SiStripRawDigi>::const_iterator digiRangeStart = digiRangeIterator; // save starting positions
995 
996  // loop all digis
997  for (; digiRangeIterator != detSetIter->data.end(); ++digiRangeIterator) {
998  const SiStripRawDigi& digi = *digiRangeIterator;
999  const int channel = distance(digiRangeStart, digiRangeIterator);
1000  if (channel >= 0 && channel < 512)
1001  currentDataProfiles.GetTECEntry(det, ring, beam, disk).SetValue(channel, digi.adc());
1002  else
1003  throw cms::Exception("[Laser Alignment::fillDataProfiles]")
1004  << " ** ERROR: raw digi channel: " << channel << " out of range for det: " << detRawId << "."
1005  << std::endl;
1006  }
1007 
1008  }
1009 
1010  else { // we have zero suppressed SiStripDigis
1011 
1012  // search the digis for the raw id
1013  edm::DetSetVector<SiStripDigi>::const_iterator detSetIter = theStripDigis->find(detRawId);
1014 
1015  // processed DetSets may be missing, just skip
1016  if (detSetIter == theStripDigis->end())
1017  continue;
1018 
1019  // fill the digis to the profiles
1020  edm::DetSet<SiStripDigi>::const_iterator digiRangeIterator = detSetIter->data.begin(); // for the loop
1021 
1022  for (; digiRangeIterator != detSetIter->data.end(); ++digiRangeIterator) {
1023  const SiStripDigi& digi = *digiRangeIterator;
1024  if (digi.strip() < 512)
1025  currentDataProfiles.GetTECEntry(det, ring, beam, disk).SetValue(digi.strip(), digi.adc());
1026  else
1027  throw cms::Exception("[Laser Alignment::fillDataProfiles]")
1028  << " ** ERROR: digi strip: " << digi.strip() << " out of range for det: " << detRawId << "."
1029  << std::endl;
1030  }
1031  }
1032 
1033  } while (moduleLoop.TECLoop(det, ring, beam, disk));
1034 
1035  // loop TIBTOB modules
1036  det = 2;
1037  beam = 0;
1038  pos = 0;
1039  do {
1040  // first clear the profile
1042 
1043  // retrieve the raw id of that module
1044  const int detRawId = detectorId.GetTIBTOBEntry(det, beam, pos);
1045 
1046  if (isRawDigi) { // we have raw SiStripRawDigis
1047 
1048  // search the digis for the raw id
1049  edm::DetSetVector<SiStripRawDigi>::const_iterator detSetIter = theStripRawDigis->find(detRawId);
1050  if (detSetIter == theStripRawDigis->end()) {
1051  throw cms::Exception("[Laser Alignment::fillDataProfiles]")
1052  << " ** ERROR: No raw DetSet found for det: " << detRawId << "." << std::endl;
1053  }
1054 
1055  // fill the digis to the profiles
1056  edm::DetSet<SiStripRawDigi>::const_iterator digiRangeIterator = detSetIter->data.begin(); // for the loop
1057  edm::DetSet<SiStripRawDigi>::const_iterator digiRangeStart = digiRangeIterator; // save starting positions
1058 
1059  // loop all digis
1060  for (; digiRangeIterator != detSetIter->data.end(); ++digiRangeIterator) {
1061  const SiStripRawDigi& digi = *digiRangeIterator;
1062  const int channel = distance(digiRangeStart, digiRangeIterator);
1063  if (channel >= 0 && channel < 512)
1064  currentDataProfiles.GetTIBTOBEntry(det, beam, pos).SetValue(channel, digi.adc());
1065  else
1066  throw cms::Exception("[Laser Alignment::fillDataProfiles]")
1067  << " ** ERROR: raw digi channel: " << channel << " out of range for det: " << detRawId << "."
1068  << std::endl;
1069  }
1070 
1071  }
1072 
1073  else { // we have zero suppressed SiStripDigis
1074 
1075  // search the digis for the raw id
1076  edm::DetSetVector<SiStripDigi>::const_iterator detSetIter = theStripDigis->find(detRawId);
1077 
1078  // processed DetSets may be missing, just skip
1079  if (detSetIter == theStripDigis->end())
1080  continue;
1081 
1082  // fill the digis to the profiles
1083  edm::DetSet<SiStripDigi>::const_iterator digiRangeIterator = detSetIter->data.begin(); // for the loop
1084 
1085  for (; digiRangeIterator != detSetIter->data.end(); ++digiRangeIterator) {
1086  const SiStripDigi& digi = *digiRangeIterator;
1087  if (digi.strip() < 512)
1088  currentDataProfiles.GetTIBTOBEntry(det, beam, pos).SetValue(digi.strip(), digi.adc());
1089  else
1090  throw cms::Exception("[Laser Alignment::fillDataProfiles]")
1091  << " ** ERROR: digi strip: " << digi.strip() << " out of range for det: " << detRawId << "."
1092  << std::endl;
1093  }
1094  }
1095 
1096  } while (moduleLoop.TIBTOBLoop(det, beam, pos));
1097 
1098  // loop TEC AT modules
1099  det = 0;
1100  beam = 0;
1101  disk = 0;
1102  do {
1103  // first clear the profile
1105 
1106  // retrieve the raw id of that module
1107  const int detRawId = detectorId.GetTEC2TECEntry(det, beam, disk);
1108 
1109  if (isRawDigi) { // we have raw SiStripRawDigis
1110 
1111  // search the digis for the raw id
1112  edm::DetSetVector<SiStripRawDigi>::const_iterator detSetIter = theStripRawDigis->find(detRawId);
1113  if (detSetIter == theStripRawDigis->end()) {
1114  throw cms::Exception("[Laser Alignment::fillDataProfiles]")
1115  << " ** ERROR: No raw DetSet found for det: " << detRawId << "." << std::endl;
1116  }
1117 
1118  // fill the digis to the profiles
1119  edm::DetSet<SiStripRawDigi>::const_iterator digiRangeIterator = detSetIter->data.begin(); // for the loop
1120  edm::DetSet<SiStripRawDigi>::const_iterator digiRangeStart = digiRangeIterator; // save starting positions
1121 
1122  // loop all digis
1123  for (; digiRangeIterator != detSetIter->data.end(); ++digiRangeIterator) {
1124  const SiStripRawDigi& digi = *digiRangeIterator;
1125  const int channel = distance(digiRangeStart, digiRangeIterator);
1126  if (channel >= 0 && channel < 512)
1127  currentDataProfiles.GetTEC2TECEntry(det, beam, disk).SetValue(channel, digi.adc());
1128  else
1129  throw cms::Exception("[Laser Alignment::fillDataProfiles]")
1130  << " ** ERROR: raw digi channel: " << channel << " out of range for det: " << detRawId << "."
1131  << std::endl;
1132  }
1133 
1134  }
1135 
1136  else { // we have zero suppressed SiStripDigis
1137 
1138  // search the digis for the raw id
1139  edm::DetSetVector<SiStripDigi>::const_iterator detSetIter = theStripDigis->find(detRawId);
1140 
1141  // processed DetSets may be missing, just skip
1142  if (detSetIter == theStripDigis->end())
1143  continue;
1144 
1145  // fill the digis to the profiles
1146  edm::DetSet<SiStripDigi>::const_iterator digiRangeIterator = detSetIter->data.begin(); // for the loop
1147 
1148  for (; digiRangeIterator != detSetIter->data.end(); ++digiRangeIterator) {
1149  const SiStripDigi& digi = *digiRangeIterator;
1150  if (digi.strip() < 512)
1151  currentDataProfiles.GetTEC2TECEntry(det, beam, disk).SetValue(digi.strip(), digi.adc());
1152  else
1153  throw cms::Exception("[Laser Alignment::fillDataProfiles]")
1154  << " ** ERROR: digi strip: " << digi.strip() << " out of range for det: " << detRawId << "."
1155  << std::endl;
1156  }
1157  }
1158 
1159  } while (moduleLoop.TEC2TECLoop(det, beam, disk));
1160 
1161  } // theDigiProducersList loop
1162 }

References SiStripDigi::adc(), SiStripRawDigi::adc(), EcalCondDBWriter_cfi::beam, edm::DetSetVector< T >::begin(), currentDataProfiles, detectorId, DataMixerDataOnData_cff::digiLabel, EcnaPython_AdcPeg12_S1_10_R170298_1_0_150_Dee0::digiProducer, HLT_FULL_cff::distance, edm::DetSetVector< T >::end(), Exception, edm::Event::getByLabel(), LASGlobalData< T >::GetTEC2TECEntry(), LASGlobalData< T >::GetTECEntry(), LASGlobalData< T >::GetTIBTOBEntry(), moduleLoop, relativeConstraints::ring, LASModuleProfile::SetAllValuesTo(), LASModuleProfile::SetValue(), AlCaHLTBitMon_QueryRunRegistry::string, SiStripDigi::strip(), LASGlobalLoop::TEC2TECLoop(), LASGlobalLoop::TECLoop(), theDigiProducersList, and LASGlobalLoop::TIBTOBLoop().

Referenced by produce().

◆ fillDetectorId()

void LaserAlignment::fillDetectorId ( void  )
private

fill hard coded detIds

all the detector ids for the LAS modules hard-coded

Definition at line 7 of file LaserAlignmentFillDetId.cc.

7  {
8  // these are the detids of the TEC modules hit
9  // by the AT as well as the TEC beams
10  tecDoubleHitDetId.push_back(470307208);
11  tecDoubleHitDetId.push_back(470323592);
12  tecDoubleHitDetId.push_back(470339976);
13  tecDoubleHitDetId.push_back(470356360);
14  tecDoubleHitDetId.push_back(470372744);
15  tecDoubleHitDetId.push_back(470307976);
16  tecDoubleHitDetId.push_back(470324360);
17  tecDoubleHitDetId.push_back(470340744);
18  tecDoubleHitDetId.push_back(470357128);
19  tecDoubleHitDetId.push_back(470373512);
20  tecDoubleHitDetId.push_back(470308488);
21  tecDoubleHitDetId.push_back(470324872);
22  tecDoubleHitDetId.push_back(470341256);
23  tecDoubleHitDetId.push_back(470357640);
24  tecDoubleHitDetId.push_back(470374024);
25  tecDoubleHitDetId.push_back(470045064);
26  tecDoubleHitDetId.push_back(470061448);
27  tecDoubleHitDetId.push_back(470077832);
28  tecDoubleHitDetId.push_back(470094216);
29  tecDoubleHitDetId.push_back(470110600);
30  tecDoubleHitDetId.push_back(470045832);
31  tecDoubleHitDetId.push_back(470062216);
32  tecDoubleHitDetId.push_back(470078600);
33  tecDoubleHitDetId.push_back(470094984);
34  tecDoubleHitDetId.push_back(470111368);
35  tecDoubleHitDetId.push_back(470046344);
36  tecDoubleHitDetId.push_back(470062728);
37  tecDoubleHitDetId.push_back(470079112);
38  tecDoubleHitDetId.push_back(470095496);
39  tecDoubleHitDetId.push_back(470111880);
40 
41  // now all the modules (above included)
42 
43  // TEC+
44  detectorId.SetTECEntry(0, 0, 0, 0, 470307208);
45  detectorId.SetTECEntry(0, 0, 0, 1, 470323592);
46  detectorId.SetTECEntry(0, 0, 0, 2, 470339976);
47  detectorId.SetTECEntry(0, 0, 0, 3, 470356360);
48  detectorId.SetTECEntry(0, 0, 0, 4, 470372744);
49  detectorId.SetTECEntry(0, 0, 0, 5, 470389128);
50  detectorId.SetTECEntry(0, 0, 0, 6, 470405512);
51  detectorId.SetTECEntry(0, 0, 0, 7, 470421896);
52  detectorId.SetTECEntry(0, 0, 0, 8, 470438280);
53  detectorId.SetTECEntry(0, 0, 1, 0, 470307464);
54  detectorId.SetTECEntry(0, 0, 1, 1, 470323848);
55  detectorId.SetTECEntry(0, 0, 1, 2, 470340232);
56  detectorId.SetTECEntry(0, 0, 1, 3, 470356616);
57  detectorId.SetTECEntry(0, 0, 1, 4, 470373000);
58  detectorId.SetTECEntry(0, 0, 1, 5, 470389384);
59  detectorId.SetTECEntry(0, 0, 1, 6, 470405768);
60  detectorId.SetTECEntry(0, 0, 1, 7, 470422152);
61  detectorId.SetTECEntry(0, 0, 1, 8, 470438536);
62  detectorId.SetTECEntry(0, 0, 2, 0, 470307720);
63  detectorId.SetTECEntry(0, 0, 2, 1, 470324104);
64  detectorId.SetTECEntry(0, 0, 2, 2, 470340488);
65  detectorId.SetTECEntry(0, 0, 2, 3, 470356872);
66  detectorId.SetTECEntry(0, 0, 2, 4, 470373256);
67  detectorId.SetTECEntry(0, 0, 2, 5, 470389640);
68  detectorId.SetTECEntry(0, 0, 2, 6, 470406024);
69  detectorId.SetTECEntry(0, 0, 2, 7, 470422408);
70  detectorId.SetTECEntry(0, 0, 2, 8, 470438792);
71  detectorId.SetTECEntry(0, 0, 3, 0, 470307976);
72  detectorId.SetTECEntry(0, 0, 3, 1, 470324360);
73  detectorId.SetTECEntry(0, 0, 3, 2, 470340744);
74  detectorId.SetTECEntry(0, 0, 3, 3, 470357128);
75  detectorId.SetTECEntry(0, 0, 3, 4, 470373512);
76  detectorId.SetTECEntry(0, 0, 3, 5, 470389896);
77  detectorId.SetTECEntry(0, 0, 3, 6, 470406280);
78  detectorId.SetTECEntry(0, 0, 3, 7, 470422664);
79  detectorId.SetTECEntry(0, 0, 3, 8, 470439048);
80  detectorId.SetTECEntry(0, 0, 4, 0, 470308232);
81  detectorId.SetTECEntry(0, 0, 4, 1, 470324616);
82  detectorId.SetTECEntry(0, 0, 4, 2, 470341000);
83  detectorId.SetTECEntry(0, 0, 4, 3, 470357384);
84  detectorId.SetTECEntry(0, 0, 4, 4, 470373768);
85  detectorId.SetTECEntry(0, 0, 4, 5, 470390152);
86  detectorId.SetTECEntry(0, 0, 4, 6, 470406536);
87  detectorId.SetTECEntry(0, 0, 4, 7, 470422920);
88  detectorId.SetTECEntry(0, 0, 4, 8, 470439304);
89  detectorId.SetTECEntry(0, 0, 5, 0, 470308488);
90  detectorId.SetTECEntry(0, 0, 5, 1, 470324872);
91  detectorId.SetTECEntry(0, 0, 5, 2, 470341256);
92  detectorId.SetTECEntry(0, 0, 5, 3, 470357640);
93  detectorId.SetTECEntry(0, 0, 5, 4, 470374024);
94  detectorId.SetTECEntry(0, 0, 5, 5, 470390408);
95  detectorId.SetTECEntry(0, 0, 5, 6, 470406792);
96  detectorId.SetTECEntry(0, 0, 5, 7, 470423176);
97  detectorId.SetTECEntry(0, 0, 5, 8, 470439560);
98  detectorId.SetTECEntry(0, 0, 6, 0, 470308744);
99  detectorId.SetTECEntry(0, 0, 6, 1, 470325128);
100  detectorId.SetTECEntry(0, 0, 6, 2, 470341512);
101  detectorId.SetTECEntry(0, 0, 6, 3, 470357896);
102  detectorId.SetTECEntry(0, 0, 6, 4, 470374280);
103  detectorId.SetTECEntry(0, 0, 6, 5, 470390664);
104  detectorId.SetTECEntry(0, 0, 6, 6, 470407048);
105  detectorId.SetTECEntry(0, 0, 6, 7, 470423432);
106  detectorId.SetTECEntry(0, 0, 6, 8, 470439816);
107  detectorId.SetTECEntry(0, 0, 7, 0, 470309000);
108  detectorId.SetTECEntry(0, 0, 7, 1, 470325384);
109  detectorId.SetTECEntry(0, 0, 7, 2, 470341768);
110  detectorId.SetTECEntry(0, 0, 7, 3, 470358152);
111  detectorId.SetTECEntry(0, 0, 7, 4, 470374536);
112  detectorId.SetTECEntry(0, 0, 7, 5, 470390920);
113  detectorId.SetTECEntry(0, 0, 7, 6, 470407304);
114  detectorId.SetTECEntry(0, 0, 7, 7, 470423688);
115  detectorId.SetTECEntry(0, 0, 7, 8, 470440072);
116  detectorId.SetTECEntry(0, 1, 0, 0, 470307272);
117  detectorId.SetTECEntry(0, 1, 0, 1, 470323656);
118  detectorId.SetTECEntry(0, 1, 0, 2, 470340040);
119  detectorId.SetTECEntry(0, 1, 0, 3, 470356424);
120  detectorId.SetTECEntry(0, 1, 0, 4, 470372808);
121  detectorId.SetTECEntry(0, 1, 0, 5, 470389192);
122  detectorId.SetTECEntry(0, 1, 0, 6, 470405576);
123  detectorId.SetTECEntry(0, 1, 0, 7, 470421960);
124  detectorId.SetTECEntry(0, 1, 0, 8, 470438344);
125  detectorId.SetTECEntry(0, 1, 1, 0, 470307528);
126  detectorId.SetTECEntry(0, 1, 1, 1, 470323912);
127  detectorId.SetTECEntry(0, 1, 1, 2, 470340296);
128  detectorId.SetTECEntry(0, 1, 1, 3, 470356680);
129  detectorId.SetTECEntry(0, 1, 1, 4, 470373064);
130  detectorId.SetTECEntry(0, 1, 1, 5, 470389448);
131  detectorId.SetTECEntry(0, 1, 1, 6, 470405832);
132  detectorId.SetTECEntry(0, 1, 1, 7, 470422216);
133  detectorId.SetTECEntry(0, 1, 1, 8, 470438600);
134  detectorId.SetTECEntry(0, 1, 2, 0, 470307784);
135  detectorId.SetTECEntry(0, 1, 2, 1, 470324168);
136  detectorId.SetTECEntry(0, 1, 2, 2, 470340552);
137  detectorId.SetTECEntry(0, 1, 2, 3, 470356936);
138  detectorId.SetTECEntry(0, 1, 2, 4, 470373320);
139  detectorId.SetTECEntry(0, 1, 2, 5, 470389704);
140  detectorId.SetTECEntry(0, 1, 2, 6, 470406088);
141  detectorId.SetTECEntry(0, 1, 2, 7, 470422472);
142  detectorId.SetTECEntry(0, 1, 2, 8, 470438856);
143  detectorId.SetTECEntry(0, 1, 3, 0, 470308040);
144  detectorId.SetTECEntry(0, 1, 3, 1, 470324424);
145  detectorId.SetTECEntry(0, 1, 3, 2, 470340808);
146  detectorId.SetTECEntry(0, 1, 3, 3, 470357192);
147  detectorId.SetTECEntry(0, 1, 3, 4, 470373576);
148  detectorId.SetTECEntry(0, 1, 3, 5, 470389960);
149  detectorId.SetTECEntry(0, 1, 3, 6, 470406344);
150  detectorId.SetTECEntry(0, 1, 3, 7, 470422728);
151  detectorId.SetTECEntry(0, 1, 3, 8, 470439112);
152  detectorId.SetTECEntry(0, 1, 4, 0, 470308296);
153  detectorId.SetTECEntry(0, 1, 4, 1, 470324680);
154  detectorId.SetTECEntry(0, 1, 4, 2, 470341064);
155  detectorId.SetTECEntry(0, 1, 4, 3, 470357448);
156  detectorId.SetTECEntry(0, 1, 4, 4, 470373832);
157  detectorId.SetTECEntry(0, 1, 4, 5, 470390216);
158  detectorId.SetTECEntry(0, 1, 4, 6, 470406600);
159  detectorId.SetTECEntry(0, 1, 4, 7, 470422984);
160  detectorId.SetTECEntry(0, 1, 4, 8, 470439368);
161  detectorId.SetTECEntry(0, 1, 5, 0, 470308552);
162  detectorId.SetTECEntry(0, 1, 5, 1, 470324936);
163  detectorId.SetTECEntry(0, 1, 5, 2, 470341320);
164  detectorId.SetTECEntry(0, 1, 5, 3, 470357704);
165  detectorId.SetTECEntry(0, 1, 5, 4, 470374088);
166  detectorId.SetTECEntry(0, 1, 5, 5, 470390472);
167  detectorId.SetTECEntry(0, 1, 5, 6, 470406856);
168  detectorId.SetTECEntry(0, 1, 5, 7, 470423240);
169  detectorId.SetTECEntry(0, 1, 5, 8, 470439624);
170  detectorId.SetTECEntry(0, 1, 6, 0, 470308808);
171  detectorId.SetTECEntry(0, 1, 6, 1, 470325192);
172  detectorId.SetTECEntry(0, 1, 6, 2, 470341576);
173  detectorId.SetTECEntry(0, 1, 6, 3, 470357960);
174  detectorId.SetTECEntry(0, 1, 6, 4, 470374344);
175  detectorId.SetTECEntry(0, 1, 6, 5, 470390728);
176  detectorId.SetTECEntry(0, 1, 6, 6, 470407112);
177  detectorId.SetTECEntry(0, 1, 6, 7, 470423496);
178  detectorId.SetTECEntry(0, 1, 6, 8, 470439880);
179  detectorId.SetTECEntry(0, 1, 7, 0, 470309064);
180  detectorId.SetTECEntry(0, 1, 7, 1, 470325448);
181  detectorId.SetTECEntry(0, 1, 7, 2, 470341832);
182  detectorId.SetTECEntry(0, 1, 7, 3, 470358216);
183  detectorId.SetTECEntry(0, 1, 7, 4, 470374600);
184  detectorId.SetTECEntry(0, 1, 7, 5, 470390984);
185  detectorId.SetTECEntry(0, 1, 7, 6, 470407368);
186  detectorId.SetTECEntry(0, 1, 7, 7, 470423752);
187  detectorId.SetTECEntry(0, 1, 7, 8, 470440136);
188 
189  // TEC-
190  detectorId.SetTECEntry(1, 0, 0, 0, 470045064);
191  detectorId.SetTECEntry(1, 0, 0, 1, 470061448);
192  detectorId.SetTECEntry(1, 0, 0, 2, 470077832);
193  detectorId.SetTECEntry(1, 0, 0, 3, 470094216);
194  detectorId.SetTECEntry(1, 0, 0, 4, 470110600);
195  detectorId.SetTECEntry(1, 0, 0, 5, 470126984);
196  detectorId.SetTECEntry(1, 0, 0, 6, 470143368);
197  detectorId.SetTECEntry(1, 0, 0, 7, 470159752);
198  detectorId.SetTECEntry(1, 0, 0, 8, 470176136);
199  detectorId.SetTECEntry(1, 0, 1, 0, 470045320);
200  detectorId.SetTECEntry(1, 0, 1, 1, 470061704);
201  detectorId.SetTECEntry(1, 0, 1, 2, 470078088);
202  detectorId.SetTECEntry(1, 0, 1, 3, 470094472);
203  detectorId.SetTECEntry(1, 0, 1, 4, 470110856);
204  detectorId.SetTECEntry(1, 0, 1, 5, 470127240);
205  detectorId.SetTECEntry(1, 0, 1, 6, 470143624);
206  detectorId.SetTECEntry(1, 0, 1, 7, 470160008);
207  detectorId.SetTECEntry(1, 0, 1, 8, 470176392);
208  detectorId.SetTECEntry(1, 0, 2, 0, 470045576);
209  detectorId.SetTECEntry(1, 0, 2, 1, 470061960);
210  detectorId.SetTECEntry(1, 0, 2, 2, 470078344);
211  detectorId.SetTECEntry(1, 0, 2, 3, 470094728);
212  detectorId.SetTECEntry(1, 0, 2, 4, 470111112);
213  detectorId.SetTECEntry(1, 0, 2, 5, 470127496);
214  detectorId.SetTECEntry(1, 0, 2, 6, 470143880);
215  detectorId.SetTECEntry(1, 0, 2, 7, 470160264);
216  detectorId.SetTECEntry(1, 0, 2, 8, 470176648);
217  detectorId.SetTECEntry(1, 0, 3, 0, 470045832);
218  detectorId.SetTECEntry(1, 0, 3, 1, 470062216);
219  detectorId.SetTECEntry(1, 0, 3, 2, 470078600);
220  detectorId.SetTECEntry(1, 0, 3, 3, 470094984);
221  detectorId.SetTECEntry(1, 0, 3, 4, 470111368);
222  detectorId.SetTECEntry(1, 0, 3, 5, 470127752);
223  detectorId.SetTECEntry(1, 0, 3, 6, 470144136);
224  detectorId.SetTECEntry(1, 0, 3, 7, 470160520);
225  detectorId.SetTECEntry(1, 0, 3, 8, 470176904);
226  detectorId.SetTECEntry(1, 0, 4, 0, 470046088);
227  detectorId.SetTECEntry(1, 0, 4, 1, 470062472);
228  detectorId.SetTECEntry(1, 0, 4, 2, 470078856);
229  detectorId.SetTECEntry(1, 0, 4, 3, 470095240);
230  detectorId.SetTECEntry(1, 0, 4, 4, 470111624);
231  detectorId.SetTECEntry(1, 0, 4, 5, 470128008);
232  detectorId.SetTECEntry(1, 0, 4, 6, 470144392);
233  detectorId.SetTECEntry(1, 0, 4, 7, 470160776);
234  detectorId.SetTECEntry(1, 0, 4, 8, 470177160);
235  detectorId.SetTECEntry(1, 0, 5, 0, 470046344);
236  detectorId.SetTECEntry(1, 0, 5, 1, 470062728);
237  detectorId.SetTECEntry(1, 0, 5, 2, 470079112);
238  detectorId.SetTECEntry(1, 0, 5, 3, 470095496);
239  detectorId.SetTECEntry(1, 0, 5, 4, 470111880);
240  detectorId.SetTECEntry(1, 0, 5, 5, 470128264);
241  detectorId.SetTECEntry(1, 0, 5, 6, 470144648);
242  detectorId.SetTECEntry(1, 0, 5, 7, 470161032);
243  detectorId.SetTECEntry(1, 0, 5, 8, 470177416);
244  detectorId.SetTECEntry(1, 0, 6, 0, 470046600);
245  detectorId.SetTECEntry(1, 0, 6, 1, 470062984);
246  detectorId.SetTECEntry(1, 0, 6, 2, 470079368);
247  detectorId.SetTECEntry(1, 0, 6, 3, 470095752);
248  detectorId.SetTECEntry(1, 0, 6, 4, 470112136);
249  detectorId.SetTECEntry(1, 0, 6, 5, 470128520);
250  detectorId.SetTECEntry(1, 0, 6, 6, 470144904);
251  detectorId.SetTECEntry(1, 0, 6, 7, 470161288);
252  detectorId.SetTECEntry(1, 0, 6, 8, 470177672);
253  detectorId.SetTECEntry(1, 0, 7, 0, 470046856);
254  detectorId.SetTECEntry(1, 0, 7, 1, 470063240);
255  detectorId.SetTECEntry(1, 0, 7, 2, 470079624);
256  detectorId.SetTECEntry(1, 0, 7, 3, 470096008);
257  detectorId.SetTECEntry(1, 0, 7, 4, 470112392);
258  detectorId.SetTECEntry(1, 0, 7, 5, 470128776);
259  detectorId.SetTECEntry(1, 0, 7, 6, 470145160);
260  detectorId.SetTECEntry(1, 0, 7, 7, 470161544);
261  detectorId.SetTECEntry(1, 0, 7, 8, 470177928);
262  detectorId.SetTECEntry(1, 1, 0, 0, 470045128);
263  detectorId.SetTECEntry(1, 1, 0, 1, 470061512);
264  detectorId.SetTECEntry(1, 1, 0, 2, 470077896);
265  detectorId.SetTECEntry(1, 1, 0, 3, 470094280);
266  detectorId.SetTECEntry(1, 1, 0, 4, 470110664);
267  detectorId.SetTECEntry(1, 1, 0, 5, 470127048);
268  detectorId.SetTECEntry(1, 1, 0, 6, 470143432);
269  detectorId.SetTECEntry(1, 1, 0, 7, 470159816);
270  detectorId.SetTECEntry(1, 1, 0, 8, 470176200);
271  detectorId.SetTECEntry(1, 1, 1, 0, 470045384);
272  detectorId.SetTECEntry(1, 1, 1, 1, 470061768);
273  detectorId.SetTECEntry(1, 1, 1, 2, 470078152);
274  detectorId.SetTECEntry(1, 1, 1, 3, 470094536);
275  detectorId.SetTECEntry(1, 1, 1, 4, 470110920);
276  detectorId.SetTECEntry(1, 1, 1, 5, 470127304);
277  detectorId.SetTECEntry(1, 1, 1, 6, 470143688);
278  detectorId.SetTECEntry(1, 1, 1, 7, 470160072);
279  detectorId.SetTECEntry(1, 1, 1, 8, 470176456);
280  detectorId.SetTECEntry(1, 1, 2, 0, 470045640);
281  detectorId.SetTECEntry(1, 1, 2, 1, 470062024);
282  detectorId.SetTECEntry(1, 1, 2, 2, 470078408);
283  detectorId.SetTECEntry(1, 1, 2, 3, 470094792);
284  detectorId.SetTECEntry(1, 1, 2, 4, 470111176);
285  detectorId.SetTECEntry(1, 1, 2, 5, 470127560);
286  detectorId.SetTECEntry(1, 1, 2, 6, 470143944);
287  detectorId.SetTECEntry(1, 1, 2, 7, 470160328);
288  detectorId.SetTECEntry(1, 1, 2, 8, 470176712);
289  detectorId.SetTECEntry(1, 1, 3, 0, 470045896);
290  detectorId.SetTECEntry(1, 1, 3, 1, 470062280);
291  detectorId.SetTECEntry(1, 1, 3, 2, 470078664);
292  detectorId.SetTECEntry(1, 1, 3, 3, 470095048);
293  detectorId.SetTECEntry(1, 1, 3, 4, 470111432);
294  detectorId.SetTECEntry(1, 1, 3, 5, 470127816);
295  detectorId.SetTECEntry(1, 1, 3, 6, 470144200);
296  detectorId.SetTECEntry(1, 1, 3, 7, 470160584);
297  detectorId.SetTECEntry(1, 1, 3, 8, 470176968);
298  detectorId.SetTECEntry(1, 1, 4, 0, 470046152);
299  detectorId.SetTECEntry(1, 1, 4, 1, 470062536);
300  detectorId.SetTECEntry(1, 1, 4, 2, 470078920);
301  detectorId.SetTECEntry(1, 1, 4, 3, 470095304);
302  detectorId.SetTECEntry(1, 1, 4, 4, 470111688);
303  detectorId.SetTECEntry(1, 1, 4, 5, 470128072);
304  detectorId.SetTECEntry(1, 1, 4, 6, 470144456);
305  detectorId.SetTECEntry(1, 1, 4, 7, 470160840);
306  detectorId.SetTECEntry(1, 1, 4, 8, 470177224);
307  detectorId.SetTECEntry(1, 1, 5, 0, 470046408);
308  detectorId.SetTECEntry(1, 1, 5, 1, 470062792);
309  detectorId.SetTECEntry(1, 1, 5, 2, 470079176);
310  detectorId.SetTECEntry(1, 1, 5, 3, 470095560);
311  detectorId.SetTECEntry(1, 1, 5, 4, 470111944);
312  detectorId.SetTECEntry(1, 1, 5, 5, 470128328);
313  detectorId.SetTECEntry(1, 1, 5, 6, 470144712);
314  detectorId.SetTECEntry(1, 1, 5, 7, 470161096);
315  detectorId.SetTECEntry(1, 1, 5, 8, 470177480);
316  detectorId.SetTECEntry(1, 1, 6, 0, 470046664);
317  detectorId.SetTECEntry(1, 1, 6, 1, 470063048);
318  detectorId.SetTECEntry(1, 1, 6, 2, 470079432);
319  detectorId.SetTECEntry(1, 1, 6, 3, 470095816);
320  detectorId.SetTECEntry(1, 1, 6, 4, 470112200);
321  detectorId.SetTECEntry(1, 1, 6, 5, 470128584);
322  detectorId.SetTECEntry(1, 1, 6, 6, 470144968);
323  detectorId.SetTECEntry(1, 1, 6, 7, 470161352);
324  detectorId.SetTECEntry(1, 1, 6, 8, 470177736);
325  detectorId.SetTECEntry(1, 1, 7, 0, 470046920);
326  detectorId.SetTECEntry(1, 1, 7, 1, 470063304);
327  detectorId.SetTECEntry(1, 1, 7, 2, 470079688);
328  detectorId.SetTECEntry(1, 1, 7, 3, 470096072);
329  detectorId.SetTECEntry(1, 1, 7, 4, 470112456);
330  detectorId.SetTECEntry(1, 1, 7, 5, 470128840);
331  detectorId.SetTECEntry(1, 1, 7, 6, 470145224);
332  detectorId.SetTECEntry(1, 1, 7, 7, 470161608);
333  detectorId.SetTECEntry(1, 1, 7, 8, 470177992);
334 
335  // TIB
336  detectorId.SetTIBTOBEntry(2, 0, 0, 369174604);
337  detectorId.SetTIBTOBEntry(2, 0, 1, 369174600);
338  detectorId.SetTIBTOBEntry(2, 0, 2, 369174596);
339  detectorId.SetTIBTOBEntry(2, 0, 3, 369170500);
340  detectorId.SetTIBTOBEntry(2, 0, 4, 369170504);
341  detectorId.SetTIBTOBEntry(2, 0, 5, 369170508);
342  detectorId.SetTIBTOBEntry(2, 1, 0, 369174732);
343  detectorId.SetTIBTOBEntry(2, 1, 1, 369174728);
344  detectorId.SetTIBTOBEntry(2, 1, 2, 369174724);
345  detectorId.SetTIBTOBEntry(2, 1, 3, 369170628);
346  detectorId.SetTIBTOBEntry(2, 1, 4, 369170632);
347  detectorId.SetTIBTOBEntry(2, 1, 5, 369170636);
348  detectorId.SetTIBTOBEntry(2, 2, 0, 369174812);
349  detectorId.SetTIBTOBEntry(2, 2, 1, 369174808);
350  detectorId.SetTIBTOBEntry(2, 2, 2, 369174804);
351  detectorId.SetTIBTOBEntry(2, 2, 3, 369170708);
352  detectorId.SetTIBTOBEntry(2, 2, 4, 369170712);
353  detectorId.SetTIBTOBEntry(2, 2, 5, 369170716);
354  detectorId.SetTIBTOBEntry(2, 3, 0, 369174940);
355  detectorId.SetTIBTOBEntry(2, 3, 1, 369174936);
356  detectorId.SetTIBTOBEntry(2, 3, 2, 369174932);
357  detectorId.SetTIBTOBEntry(2, 3, 3, 369170836);
358  detectorId.SetTIBTOBEntry(2, 3, 4, 369170840);
359  detectorId.SetTIBTOBEntry(2, 3, 5, 369170844);
360  detectorId.SetTIBTOBEntry(2, 4, 0, 369175068);
361  detectorId.SetTIBTOBEntry(2, 4, 1, 369175064);
362  detectorId.SetTIBTOBEntry(2, 4, 2, 369175060);
363  detectorId.SetTIBTOBEntry(2, 4, 3, 369170964);
364  detectorId.SetTIBTOBEntry(2, 4, 4, 369170968);
365  detectorId.SetTIBTOBEntry(2, 4, 5, 369170972);
366  detectorId.SetTIBTOBEntry(2, 5, 0, 369175164);
367  detectorId.SetTIBTOBEntry(2, 5, 1, 369175160);
368  detectorId.SetTIBTOBEntry(2, 5, 2, 369175156);
369  detectorId.SetTIBTOBEntry(2, 5, 3, 369171060);
370  detectorId.SetTIBTOBEntry(2, 5, 4, 369171064);
371  detectorId.SetTIBTOBEntry(2, 5, 5, 369171068);
372  detectorId.SetTIBTOBEntry(2, 6, 0, 369175292);
373  detectorId.SetTIBTOBEntry(2, 6, 1, 369175288);
374  detectorId.SetTIBTOBEntry(2, 6, 2, 369175284);
375  detectorId.SetTIBTOBEntry(2, 6, 3, 369171188);
376  detectorId.SetTIBTOBEntry(2, 6, 4, 369171192);
377  detectorId.SetTIBTOBEntry(2, 6, 5, 369171196);
378  detectorId.SetTIBTOBEntry(2, 7, 0, 369175372);
379  detectorId.SetTIBTOBEntry(2, 7, 1, 369175368);
380  detectorId.SetTIBTOBEntry(2, 7, 2, 369175364);
381  detectorId.SetTIBTOBEntry(2, 7, 3, 369171268);
382  detectorId.SetTIBTOBEntry(2, 7, 4, 369171272);
383  detectorId.SetTIBTOBEntry(2, 7, 5, 369171276);
384 
385  // TOB
386  detectorId.SetTIBTOBEntry(3, 0, 0, 436232314);
387  detectorId.SetTIBTOBEntry(3, 0, 1, 436232306);
388  detectorId.SetTIBTOBEntry(3, 0, 2, 436232298);
389  detectorId.SetTIBTOBEntry(3, 0, 3, 436228198);
390  detectorId.SetTIBTOBEntry(3, 0, 4, 436228206);
391  detectorId.SetTIBTOBEntry(3, 0, 5, 436228214);
392  detectorId.SetTIBTOBEntry(3, 1, 0, 436232506);
393  detectorId.SetTIBTOBEntry(3, 1, 1, 436232498);
394  detectorId.SetTIBTOBEntry(3, 1, 2, 436232490);
395  detectorId.SetTIBTOBEntry(3, 1, 3, 436228390);
396  detectorId.SetTIBTOBEntry(3, 1, 4, 436228398);
397  detectorId.SetTIBTOBEntry(3, 1, 5, 436228406);
398  detectorId.SetTIBTOBEntry(3, 2, 0, 436232634);
399  detectorId.SetTIBTOBEntry(3, 2, 1, 436232626);
400  detectorId.SetTIBTOBEntry(3, 2, 2, 436232618);
401  detectorId.SetTIBTOBEntry(3, 2, 3, 436228518);
402  detectorId.SetTIBTOBEntry(3, 2, 4, 436228526);
403  detectorId.SetTIBTOBEntry(3, 2, 5, 436228534);
404  detectorId.SetTIBTOBEntry(3, 3, 0, 436232826);
405  detectorId.SetTIBTOBEntry(3, 3, 1, 436232818);
406  detectorId.SetTIBTOBEntry(3, 3, 2, 436232810);
407  detectorId.SetTIBTOBEntry(3, 3, 3, 436228710);
408  detectorId.SetTIBTOBEntry(3, 3, 4, 436228718);
409  detectorId.SetTIBTOBEntry(3, 3, 5, 436228726);
410  detectorId.SetTIBTOBEntry(3, 4, 0, 436233018);
411  detectorId.SetTIBTOBEntry(3, 4, 1, 436233010);
412  detectorId.SetTIBTOBEntry(3, 4, 2, 436233002);
413  detectorId.SetTIBTOBEntry(3, 4, 3, 436228902);
414  detectorId.SetTIBTOBEntry(3, 4, 4, 436228910);
415  detectorId.SetTIBTOBEntry(3, 4, 5, 436228918);
416  detectorId.SetTIBTOBEntry(3, 5, 0, 436233146);
417  detectorId.SetTIBTOBEntry(3, 5, 1, 436233138);
418  detectorId.SetTIBTOBEntry(3, 5, 2, 436233130);
419  detectorId.SetTIBTOBEntry(3, 5, 3, 436229030);
420  detectorId.SetTIBTOBEntry(3, 5, 4, 436229038);
421  detectorId.SetTIBTOBEntry(3, 5, 5, 436229046);
422  detectorId.SetTIBTOBEntry(3, 6, 0, 436233338);
423  detectorId.SetTIBTOBEntry(3, 6, 1, 436233330);
424  detectorId.SetTIBTOBEntry(3, 6, 2, 436233322);
425  detectorId.SetTIBTOBEntry(3, 6, 3, 436229222);
426  detectorId.SetTIBTOBEntry(3, 6, 4, 436229230);
427  detectorId.SetTIBTOBEntry(3, 6, 5, 436229238);
428  detectorId.SetTIBTOBEntry(3, 7, 0, 436233466);
429  detectorId.SetTIBTOBEntry(3, 7, 1, 436233458);
430  detectorId.SetTIBTOBEntry(3, 7, 2, 436233450);
431  detectorId.SetTIBTOBEntry(3, 7, 3, 436229350);
432  detectorId.SetTIBTOBEntry(3, 7, 4, 436229358);
433  detectorId.SetTIBTOBEntry(3, 7, 5, 436229366);
434 
435  // TEC+ AT
436  detectorId.SetTEC2TECEntry(0, 0, 0, 470307208);
437  detectorId.SetTEC2TECEntry(0, 0, 1, 470323592);
438  detectorId.SetTEC2TECEntry(0, 0, 2, 470339976);
439  detectorId.SetTEC2TECEntry(0, 0, 3, 470356360);
440  detectorId.SetTEC2TECEntry(0, 0, 4, 470372744);
441  detectorId.SetTEC2TECEntry(0, 1, 0, 470307468);
442  detectorId.SetTEC2TECEntry(0, 1, 1, 470323852);
443  detectorId.SetTEC2TECEntry(0, 1, 2, 470340236);
444  detectorId.SetTEC2TECEntry(0, 1, 3, 470356620);
445  detectorId.SetTEC2TECEntry(0, 1, 4, 470373004);
446  detectorId.SetTEC2TECEntry(0, 2, 0, 470307716);
447  detectorId.SetTEC2TECEntry(0, 2, 1, 470324100);
448  detectorId.SetTEC2TECEntry(0, 2, 2, 470340484);
449  detectorId.SetTEC2TECEntry(0, 2, 3, 470356868);
450  detectorId.SetTEC2TECEntry(0, 2, 4, 470373252);
451  detectorId.SetTEC2TECEntry(0, 3, 0, 470307976);
452  detectorId.SetTEC2TECEntry(0, 3, 1, 470324360);
453  detectorId.SetTEC2TECEntry(0, 3, 2, 470340744);
454  detectorId.SetTEC2TECEntry(0, 3, 3, 470357128);
455  detectorId.SetTEC2TECEntry(0, 3, 4, 470373512);
456  detectorId.SetTEC2TECEntry(0, 4, 0, 470308236);
457  detectorId.SetTEC2TECEntry(0, 4, 1, 470324620);
458  detectorId.SetTEC2TECEntry(0, 4, 2, 470341004);
459  detectorId.SetTEC2TECEntry(0, 4, 3, 470357388);
460  detectorId.SetTEC2TECEntry(0, 4, 4, 470373772);
461  detectorId.SetTEC2TECEntry(0, 5, 0, 470308488);
462  detectorId.SetTEC2TECEntry(0, 5, 1, 470324872);
463  detectorId.SetTEC2TECEntry(0, 5, 2, 470341256);
464  detectorId.SetTEC2TECEntry(0, 5, 3, 470357640);
465  detectorId.SetTEC2TECEntry(0, 5, 4, 470374024);
466  detectorId.SetTEC2TECEntry(0, 6, 0, 470308748);
467  detectorId.SetTEC2TECEntry(0, 6, 1, 470325132);
468  detectorId.SetTEC2TECEntry(0, 6, 2, 470341516);
469  detectorId.SetTEC2TECEntry(0, 6, 3, 470357900);
470  detectorId.SetTEC2TECEntry(0, 6, 4, 470374284);
471  detectorId.SetTEC2TECEntry(0, 7, 0, 470308996);
472  detectorId.SetTEC2TECEntry(0, 7, 1, 470325380);
473  detectorId.SetTEC2TECEntry(0, 7, 2, 470341764);
474  detectorId.SetTEC2TECEntry(0, 7, 3, 470358148);
475  detectorId.SetTEC2TECEntry(0, 7, 4, 470374532);
476 
477  // TEC- AT
478  detectorId.SetTEC2TECEntry(1, 0, 0, 470045064);
479  detectorId.SetTEC2TECEntry(1, 0, 1, 470061448);
480  detectorId.SetTEC2TECEntry(1, 0, 2, 470077832);
481  detectorId.SetTEC2TECEntry(1, 0, 3, 470094216);
482  detectorId.SetTEC2TECEntry(1, 0, 4, 470110600);
483  detectorId.SetTEC2TECEntry(1, 1, 0, 470045316);
484  detectorId.SetTEC2TECEntry(1, 1, 1, 470061700);
485  detectorId.SetTEC2TECEntry(1, 1, 2, 470078084);
486  detectorId.SetTEC2TECEntry(1, 1, 3, 470094468);
487  detectorId.SetTEC2TECEntry(1, 1, 4, 470110852);
488  detectorId.SetTEC2TECEntry(1, 2, 0, 470045580);
489  detectorId.SetTEC2TECEntry(1, 2, 1, 470061964);
490  detectorId.SetTEC2TECEntry(1, 2, 2, 470078348);
491  detectorId.SetTEC2TECEntry(1, 2, 3, 470094732);
492  detectorId.SetTEC2TECEntry(1, 2, 4, 470111116);
493  detectorId.SetTEC2TECEntry(1, 3, 0, 470045832);
494  detectorId.SetTEC2TECEntry(1, 3, 1, 470062216);
495  detectorId.SetTEC2TECEntry(1, 3, 2, 470078600);
496  detectorId.SetTEC2TECEntry(1, 3, 3, 470094984);
497  detectorId.SetTEC2TECEntry(1, 3, 4, 470111368);
498  detectorId.SetTEC2TECEntry(1, 4, 0, 470046084);
499  detectorId.SetTEC2TECEntry(1, 4, 1, 470062468);
500  detectorId.SetTEC2TECEntry(1, 4, 2, 470078852);
501  detectorId.SetTEC2TECEntry(1, 4, 3, 470095236);
502  detectorId.SetTEC2TECEntry(1, 4, 4, 470111620);
503  detectorId.SetTEC2TECEntry(1, 5, 0, 470046344);
504  detectorId.SetTEC2TECEntry(1, 5, 1, 470062728);
505  detectorId.SetTEC2TECEntry(1, 5, 2, 470079112);
506  detectorId.SetTEC2TECEntry(1, 5, 3, 470095496);
507  detectorId.SetTEC2TECEntry(1, 5, 4, 470111880);
508  detectorId.SetTEC2TECEntry(1, 6, 0, 470046596);
509  detectorId.SetTEC2TECEntry(1, 6, 1, 470062980);
510  detectorId.SetTEC2TECEntry(1, 6, 2, 470079364);
511  detectorId.SetTEC2TECEntry(1, 6, 3, 470095748);
512  detectorId.SetTEC2TECEntry(1, 6, 4, 470112132);
513  detectorId.SetTEC2TECEntry(1, 7, 0, 470046860);
514  detectorId.SetTEC2TECEntry(1, 7, 1, 470063244);
515  detectorId.SetTEC2TECEntry(1, 7, 2, 470079628);
516  detectorId.SetTEC2TECEntry(1, 7, 3, 470096012);
517  detectorId.SetTEC2TECEntry(1, 7, 4, 470112396);
518 }

References detectorId, LASGlobalData< T >::SetTEC2TECEntry(), LASGlobalData< T >::SetTECEntry(), LASGlobalData< T >::SetTIBTOBEntry(), and tecDoubleHitDetId.

Referenced by beginJob().

◆ fillPedestalProfiles()

void LaserAlignment::fillPedestalProfiles ( edm::ESHandle< SiStripPedestals > &  pedestalsHandle)
private

fill pedestals from dbase

This function fills the pedestal profiles (LASGlobalData<LASModuleProfiles> pedestalProfiles) from the ESHandle (from file or DB)

Argument: readily connected SiStripPedestals object (get() alredy called) The functionality inside the loops is basically taken from: CommonTools/SiStripZeroSuppression/src/SiStripPedestalsSubtractor.cc

Definition at line 1172 of file LaserAlignment.cc.

1172  {
1173  int det, ring, beam, disk, pos;
1174 
1175  // loop TEC modules (yet without AT)
1176  det = 0;
1177  ring = 0;
1178  beam = 0;
1179  disk = 0;
1180  do { // loop using LASGlobalLoop functionality
1181  SiStripPedestals::Range pedRange = pedestalsHandle->getRange(detectorId.GetTECEntry(det, ring, beam, disk));
1182  for (int strip = 0; strip < 512; ++strip) {
1183  int thePedestal = int(pedestalsHandle->getPed(strip, pedRange));
1184  if (thePedestal > 895)
1185  thePedestal -= 1024;
1186  pedestalProfiles.GetTECEntry(det, ring, beam, disk).SetValue(strip, thePedestal);
1187  }
1188  } while (moduleLoop.TECLoop(det, ring, beam, disk));
1189 
1190  // TIB & TOB section
1191  det = 2;
1192  beam = 0;
1193  pos = 0;
1194  do { // loop using LASGlobalLoop functionality
1195  SiStripPedestals::Range pedRange = pedestalsHandle->getRange(detectorId.GetTIBTOBEntry(det, beam, pos));
1196  for (int strip = 0; strip < 512; ++strip) {
1197  int thePedestal = int(pedestalsHandle->getPed(strip, pedRange));
1198  if (thePedestal > 895)
1199  thePedestal -= 1024;
1200  pedestalProfiles.GetTIBTOBEntry(det, beam, pos).SetValue(strip, thePedestal);
1201  }
1202  } while (moduleLoop.TIBTOBLoop(det, beam, pos));
1203 
1204  // TEC2TEC AT section
1205  det = 0;
1206  beam = 0;
1207  disk = 0;
1208  do { // loop using LASGlobalLoop functionality
1209  SiStripPedestals::Range pedRange = pedestalsHandle->getRange(detectorId.GetTEC2TECEntry(det, beam, disk));
1210  for (int strip = 0; strip < 512; ++strip) {
1211  int thePedestal = int(pedestalsHandle->getPed(strip, pedRange));
1212  if (thePedestal > 895)
1213  thePedestal -= 1024;
1214  pedestalProfiles.GetTEC2TECEntry(det, beam, disk).SetValue(strip, thePedestal);
1215  }
1216  } while (moduleLoop.TEC2TECLoop(det, beam, disk));
1217 }

References EcalCondDBWriter_cfi::beam, detectorId, SiStripPedestals::getPed(), SiStripPedestals::getRange(), LASGlobalData< T >::GetTEC2TECEntry(), LASGlobalData< T >::GetTECEntry(), LASGlobalData< T >::GetTIBTOBEntry(), createfilelist::int, moduleLoop, pedestalProfiles, relativeConstraints::ring, LASModuleProfile::SetValue(), digitizers_cfi::strip, LASGlobalLoop::TEC2TECLoop(), LASGlobalLoop::TECLoop(), and LASGlobalLoop::TIBTOBLoop().

Referenced by produce().

◆ getTEC2TECNominalBeamOffset()

double LaserAlignment::getTEC2TECNominalBeamOffset ( unsigned int  det,
unsigned int  beam,
unsigned int  disk 
)
private

returns the nominal beam position (strips) in TEC (AT) for the profileJudge

not all TEC-AT modules are hit in the center; this func returns the nominal beam offset locally on a module (in strips) for the ProfileJudge and the LASPeakFinder in strips. (offset = middle of module - nominal position)

the hard coded numbers will later be supplied by a special geometry class..

Definition at line 1313 of file LaserAlignment.cc.

1313  {
1314  if (det > 1 || beam > 7 || disk > 5) {
1315  throw cms::Exception("[LaserAlignment::getTEC2TECNominalBeamOffset]")
1316  << " ERROR ** Called with nonexisting parameter set: det " << det << " beam " << beam << " disk " << disk << "."
1317  << std::endl;
1318  }
1319 
1320  const double nominalOffsets[8] = {0., 2.220, -2.221, 0., 2.214, 0., 2.214, -2.217};
1321 
1322  if (det == 0)
1323  return -1. * nominalOffsets[beam];
1324  else
1325  return nominalOffsets[beam];
1326 }

References EcalCondDBWriter_cfi::beam, and Exception.

Referenced by endRunProduce().

◆ getTIBTOBNominalBeamOffset()

double LaserAlignment::getTIBTOBNominalBeamOffset ( unsigned int  det,
unsigned int  beam,
unsigned int  pos 
)
private

returns the nominal beam position (strips) in TOB for the profileJudge

not all TIB & TOB modules are hit in the center; this func returns the nominal beam offset locally on a module (in strips) for the ProfileJudge and the LASPeakFinder in strips. (offset = middle of module - nominal position)

the hard coded numbers will later be supplied by a special geometry class..

Definition at line 1278 of file LaserAlignment.cc.

1278  {
1279  if (det < 2 || det > 3 || beam > 7 || pos > 5) {
1280  throw cms::Exception("[LaserAlignment::getTIBTOBNominalBeamOffset]")
1281  << " ERROR ** Called with nonexisting parameter set: det " << det << " beam " << beam << " pos " << pos << "."
1282  << std::endl;
1283  }
1284 
1285  const double nominalOffsetsTIB[8] = {
1286  0.00035, 2.10687, -2.10827, -0.00173446, 2.10072, -0.00135114, 2.10105, -2.10401};
1287 
1288  // in tob, modules have alternating orientations along the rods.
1289  // this is described by the following pattern.
1290  // (even more confusing, this pattern is inversed for beams 0, 5, 6, 7)
1291  const int orientationPattern[6] = {-1, 1, 1, -1, -1, 1};
1292  const double nominalOffsetsTOB[8] = {0.00217408, 1.58678, 117.733, 119.321, 120.906, 119.328, 117.743, 1.58947};
1293 
1294  if (det == 2)
1295  return (-1. * nominalOffsetsTIB[beam]);
1296 
1297  else {
1298  if (beam == 0 or beam > 4)
1299  return (nominalOffsetsTOB[beam] * orientationPattern[pos]);
1300  else
1301  return (-1. * nominalOffsetsTOB[beam] * orientationPattern[pos]);
1302  }
1303 }

References EcalCondDBWriter_cfi::beam, Exception, and or.

Referenced by endRunProduce(), and produce().

◆ isATBeam()

bool LaserAlignment::isATBeam ( void  )
private

count useable profiles in TIBTOB, operates on LASGlobalData<bool> LaserAlignment::isAcceptedProfile to allow for more elaborate patterns in the future

Definition at line 1251 of file LaserAlignment.cc.

1251  {
1252  int numberOfProfiles = 0;
1253 
1254  int det = 2;
1255  int beam = 0;
1256  int pos = 0; // search all TIB/TOB for signals
1257  do {
1258  if (isAcceptedProfile.GetTIBTOBEntry(det, beam, pos) == 1)
1259  numberOfProfiles++;
1260  } while (moduleLoop.TIBTOBLoop(det, beam, pos));
1261 
1262  LogDebug("[LaserAlignment::isATBeam]") << " Found: " << numberOfProfiles << "hits." << std::endl;
1263  std::cout << " [LaserAlignment::isATBeam] -- Found: " << numberOfProfiles << " hits." << std::endl;
1264 
1265  if (numberOfProfiles > 10)
1266  return (true);
1267  return (false);
1268 }

References EcalCondDBWriter_cfi::beam, gather_cfg::cout, LASGlobalData< T >::GetTIBTOBEntry(), isAcceptedProfile, LogDebug, moduleLoop, and LASGlobalLoop::TIBTOBLoop().

Referenced by produce().

◆ isTECBeam()

bool LaserAlignment::isTECBeam ( void  )
private

decide whether TEC or AT beams have fired

count useable profiles in TEC, operates on LASGlobalData<int> LaserAlignment::isAcceptedProfile to allow for more elaborate patterns in the future

Definition at line 1224 of file LaserAlignment.cc.

1224  {
1225  int numberOfProfiles = 0;
1226 
1227  int ring = 1; // search all ring6 modules for signals
1228  for (int det = 0; det < 2; ++det) {
1229  for (int beam = 0; beam < 8; ++beam) {
1230  for (int disk = 0; disk < 9; ++disk) {
1231  if (isAcceptedProfile.GetTECEntry(det, ring, beam, disk) == 1)
1232  numberOfProfiles++;
1233  }
1234  }
1235  }
1236 
1237  LogDebug("[LaserAlignment::isTECBeam]") << " Found: " << numberOfProfiles << "hits." << std::endl;
1238  std::cout << " [LaserAlignment::isTECBeam] -- Found: " << numberOfProfiles << " hits." << std::endl;
1239 
1240  if (numberOfProfiles > 10)
1241  return (true);
1242  return (false);
1243 }

References EcalCondDBWriter_cfi::beam, gather_cfg::cout, LASGlobalData< T >::GetTECEntry(), isAcceptedProfile, LogDebug, and relativeConstraints::ring.

Referenced by produce().

◆ produce()

void LaserAlignment::produce ( edm::Event theEvent,
edm::EventSetup const &  theSetup 
)
overridevirtual

Implements edm::one::EDProducerBase.

Definition at line 280 of file LaserAlignment.cc.

280  {
281  if (firstEvent_) {
282  //Retrieve tracker topology from geometry
283  const TrackerTopology* const tTopo = &theSetup.getData(topoToken_);
284 
285  // access the tracker
286  gD = theSetup.getHandle(geomDetToken_);
287  theTrackerGeometry = theSetup.getHandle(geomToken_);
288 
289  // access pedestals (from db..) if desired
290  edm::ESHandle<SiStripPedestals> pedestalsHandle;
292  pedestalsHandle = theSetup.getHandle(stripPedestalsToken_);
293  fillPedestalProfiles(pedestalsHandle);
294  }
295 
296  // global positions
297  theGlobalPositionRcd = &theSetup.getData(gprToken_);
298 
299  // select the reference geometry
301  // the AlignableTracker object is initialized with the ideal geometry
302  const GeometricDet* theGeometricDet = &theSetup.getData(geomDetToken_);
303  const PTrackerParameters* ptp = &theSetup.getData(ptpToken_);
304  const PTrackerAdditionalParametersPerDet* ptitp = &theSetup.getData(ptitpToken_);
305 
306  TrackerGeomBuilderFromGeometricDet trackerBuilder;
307  TrackerGeometry* theRefTracker = trackerBuilder.build(&*theGeometricDet, &*ptitp, *ptp, tTopo);
308 
309  theAlignableTracker = new AlignableTracker(&(*theRefTracker), tTopo);
310  } else {
311  // the AlignableTracker object is initialized with the input geometry from DB
313  }
314 
315  firstEvent_ = false;
316  }
317 
318  LogDebug("LaserAlignment") << "==========================================================="
319  << "\n Private analysis of event #" << theEvent.id().event() << " in run #"
320  << theEvent.id().run();
321 
322  // do the Tracker Statistics to retrieve the current profiles
323  fillDataProfiles(theEvent, theSetup);
324 
325  // index variables for the LASGlobalLoop object
326  int det, ring, beam, disk, pos;
327 
328  //
329  // first pre-loop on selected entries to find out
330  // whether the TEC or the AT beams have fired
331  // (pedestal profiles are left empty if false in cfg)
332  //
333 
334  // TEC+- (only ring 6)
335  ring = 1;
336  for (det = 0; det < 2; ++det) {
337  for (beam = 0; beam < 8; ++beam) {
338  for (disk = 0; disk < 9; ++disk) {
340  pedestalProfiles.GetTECEntry(det, ring, beam, disk),
341  0)) {
342  isAcceptedProfile.SetTECEntry(det, ring, beam, disk, 1);
343  } else { // assume no initialization
344  isAcceptedProfile.SetTECEntry(det, ring, beam, disk, 0);
345  }
346  }
347  }
348  }
349 
350  // TIBTOB
351  det = 2;
352  beam = 0;
353  pos = 0;
354  do {
355  // add current event's data and subtract pedestals
356  if (judge.IsSignalIn(
360  } else { // dto.
362  }
363 
364  } while (moduleLoop.TIBTOBLoop(det, beam, pos));
365 
366  // now come the beam finders
367  bool isTECMode = isTECBeam();
368  // LogDebug( " [LaserAlignment::produce]" ) << "LaserAlignment::isTECBeam declares this event " << ( isTECMode ? "" : "NOT " ) << "a TEC event." << std::endl;
369  std::cout << " [LaserAlignment::produce] -- LaserAlignment::isTECBeam declares this event "
370  << (isTECMode ? "" : "NOT ") << "a TEC event." << std::endl;
371 
372  bool isATMode = isATBeam();
373  // LogDebug( " [LaserAlignment::produce]" ) << "LaserAlignment::isATBeam declares this event " << ( isATMode ? "" : "NOT " ) << "an AT event." << std::endl;
374  std::cout << " [LaserAlignment::produce] -- LaserAlignment::isATBeam declares this event " << (isATMode ? "" : "NOT ")
375  << "an AT event." << std::endl;
376 
377  //
378  // now pass the pedestal subtracted profiles to the judge
379  // if they're accepted, add them on the collectedDataProfiles
380  // (pedestal profiles are left empty if false in cfg)
381  //
382 
383  // loop TEC+- modules
384  det = 0;
385  ring = 0;
386  beam = 0;
387  disk = 0;
388  do {
389  LogDebug("[LaserAlignment::produce]")
390  << "Profile is: " << theProfileNames.GetTECEntry(det, ring, beam, disk) << "." << std::endl;
391 
392  // this now depends on the AT/TEC mode, is this a doubly hit module? -> look for it in vector<int> tecDoubleHitDetId
393  // (ring == 0 not necessary but makes it a little faster)
394  if (ring == 0 &&
395  find(tecDoubleHitDetId.begin(), tecDoubleHitDetId.end(), detectorId.GetTECEntry(det, ring, beam, disk)) !=
396  tecDoubleHitDetId.end()) {
397  if (isTECMode) { // add profile to TEC collection
398  // add current event's data and subtract pedestals
400  pedestalProfiles.GetTECEntry(det, ring, beam, disk),
401  0)) {
404  pedestalProfiles.GetTECEntry(det, ring, beam, disk);
406  }
407  }
408  }
409 
410  else { // not a doubly hit module, don't care about the mode
411  // add current event's data and subtract pedestals
413  pedestalProfiles.GetTECEntry(det, ring, beam, disk),
414  0)) {
417  pedestalProfiles.GetTECEntry(det, ring, beam, disk);
419  }
420  }
421 
422  } while (moduleLoop.TECLoop(det, ring, beam, disk));
423 
424  // loop TIB/TOB modules
425  det = 2;
426  beam = 0;
427  pos = 0;
428  do {
429  LogDebug("[LaserAlignment::produce]")
430  << "Profile is: " << theProfileNames.GetTIBTOBEntry(det, beam, pos) << "." << std::endl;
431 
432  // add current event's data and subtract pedestals
433  if (judge.JudgeProfile(
439  }
440 
441  } while (moduleLoop.TIBTOBLoop(det, beam, pos));
442 
443  // loop TEC2TEC modules
444  det = 0;
445  beam = 0;
446  disk = 0;
447  do {
448  LogDebug("[LaserAlignment::produce]")
449  << "Profile is: " << theProfileNames.GetTEC2TECEntry(det, beam, disk) << "." << std::endl;
450 
451  // this again depends on the AT/TEC mode, is this a doubly hit module?
452  // (ring == 0 not necessary but makes it a little faster)
453  if (ring == 0 &&
454  find(tecDoubleHitDetId.begin(), tecDoubleHitDetId.end(), detectorId.GetTECEntry(det, ring, beam, disk)) !=
455  tecDoubleHitDetId.end()) {
456  if (isATMode) { // add profile to TEC2TEC collection
457  // add current event's data and subtract pedestals
460  0)) {
464  }
465  }
466 
467  }
468 
469  else { // not a doubly hit module, don't care about the mode
470  // add current event's data and subtract pedestals
471  if (judge.JudgeProfile(
473  0)) {
477  }
478  }
479 
480  } while (moduleLoop.TEC2TECLoop(det, beam, disk));
481 
482  // total event number counter
483  theEvents++;
484 }

References EcalCondDBWriter_cfi::beam, TrackerGeomBuilderFromGeometricDet::build(), collectedDataProfiles, gather_cfg::cout, currentDataProfiles, detectorId, edm::EventID::event(), fillDataProfiles(), fillPedestalProfiles(), spr::find(), firstEvent_, gD, geomDetToken_, geomToken_, edm::EventSetup::getData(), edm::EventSetup::getHandle(), LASGlobalData< T >::GetTEC2TECEntry(), LASGlobalData< T >::GetTECEntry(), LASGlobalData< T >::GetTIBTOBEntry(), getTIBTOBNominalBeamOffset(), gprToken_, edm::EventBase::id(), isAcceptedProfile, isATBeam(), LASProfileJudge::IsSignalIn(), isTECBeam(), judge, LASProfileJudge::JudgeProfile(), LogDebug, moduleLoop, numberOfAcceptedProfiles, pedestalProfiles, ptitpToken_, ptpToken_, relativeConstraints::ring, edm::EventID::run(), LASGlobalData< T >::SetTECEntry(), LASGlobalData< T >::SetTIBTOBEntry(), stripPedestalsToken_, LASGlobalLoop::TEC2TECLoop(), tecDoubleHitDetId, LASGlobalLoop::TECLoop(), theAlignableTracker, theDoPedestalSubtraction, theEvents, theGlobalPositionRcd, theProfileNames, theTrackerGeometry, LASGlobalLoop::TIBTOBLoop(), topoToken_, and updateFromInputGeometry.

◆ testRoutine()

void LaserAlignment::testRoutine ( void  )

for debugging & testing only, will disappear..

this function is for debugging and testing only and will disappear..

Definition at line 1685 of file LaserAlignment.cc.

1685  {
1686  // tracker geom. object for calculating the global beam positions
1687  const TrackerGeometry& theTracker(*theTrackerGeometry);
1688 
1689  const double atPhiPositions[8] = {0.392699, 1.289799, 1.851794, 2.748894, 3.645995, 4.319690, 5.216791, 5.778784};
1690  const double tecPhiPositions[8] = {0.392699, 1.178097, 1.963495, 2.748894, 3.534292, 4.319690, 5.105088, 5.890486};
1691  const double zPositions[9] = {125.0, 139.0, 153.0, 167.0, 181.0, 198.5, 217.5, 238.0, 259.5};
1692  const double zPositionsTIB[6] = {62.0, 38.0, 18.0, -10.0, -34.0, -54.0};
1693  const double zPositionsTOB[6] = {104.0, 58.0, 22.0, -14.0, -50.0, -86.0};
1694 
1695  int det, beam, disk, pos, ring;
1696 
1697  // loop TEC+- internal
1698  det = 0;
1699  ring = 0;
1700  beam = 0;
1701  disk = 0;
1702  do {
1703  const double radius = ring ? 84.0 : 56.4;
1704 
1705  // access the tracker geometry for this module
1706  const DetId theDetId(detectorId.GetTECEntry(det, ring, beam, disk));
1707  const StripGeomDetUnit* const theStripDet = dynamic_cast<const StripGeomDetUnit*>(theTracker.idToDet(theDetId));
1708 
1709  if (theStripDet) {
1710  const GlobalPoint gp(GlobalPoint::Cylindrical(radius, tecPhiPositions[beam], zPositions[disk]));
1711 
1712  const LocalPoint lp(theStripDet->surface().toLocal(gp));
1713  std::cout << "__TEC: " << 256. - theStripDet->specificTopology().strip(lp)
1714  << std::endl;
1715  }
1716 
1717  } while (moduleLoop.TECLoop(det, ring, beam, disk));
1718 
1719  // loop TIBTOB
1720  det = 2;
1721  beam = 0;
1722  pos = 0;
1723  do {
1724  const double radius =
1725  (det == 2 ? 51.4 : 58.4);
1726  const double theZ = (det == 2 ? zPositionsTIB[pos] : zPositionsTOB[pos]);
1727 
1728  // access the tracker geometry for this module
1729  const DetId theDetId(detectorId.GetTIBTOBEntry(det, beam, pos));
1730  const StripGeomDetUnit* const theStripDet = dynamic_cast<const StripGeomDetUnit*>(theTracker.idToDet(theDetId));
1731 
1732  if (theStripDet) {
1733  const GlobalPoint gp(GlobalPoint::Cylindrical(radius, atPhiPositions[beam], theZ));
1734 
1735  const LocalPoint lp(theStripDet->surface().toLocal(gp));
1736  std::cout << "__TIBTOB det " << det << " beam " << beam << " pos " << pos << " "
1737  << 256. - theStripDet->specificTopology().strip(lp);
1738  std::cout << " " << theStripDet->position().perp() << std::endl;
1739  }
1740 
1741  } while (moduleLoop.TIBTOBLoop(det, beam, pos));
1742 
1743  // loop TEC2TEC
1744  det = 0;
1745  beam = 0;
1746  disk = 0;
1747  do {
1748  const double radius = 56.4;
1749 
1750  // access the tracker geometry for this module
1751  const DetId theDetId(detectorId.GetTEC2TECEntry(det, beam, disk));
1752  const StripGeomDetUnit* const theStripDet = dynamic_cast<const StripGeomDetUnit*>(theTracker.idToDet(theDetId));
1753 
1754  if (theStripDet) {
1755  const GlobalPoint gp(GlobalPoint::Cylindrical(radius, atPhiPositions[beam], zPositions[disk]));
1756 
1757  const LocalPoint lp(theStripDet->surface().toLocal(gp));
1758  std::cout << "__TEC2TEC det " << det << " beam " << beam << " disk " << disk << " "
1759  << 256. - theStripDet->specificTopology().strip(lp) << std::endl;
1760  }
1761 
1762  } while (moduleLoop.TEC2TECLoop(det, beam, disk));
1763 }

References EcalCondDBWriter_cfi::beam, gather_cfg::cout, detectorId, LASGlobalData< T >::GetTEC2TECEntry(), LASGlobalData< T >::GetTECEntry(), LASGlobalData< T >::GetTIBTOBEntry(), runTauDisplay::gp, TrackerGeometry::idToDet(), moduleLoop, CosmicsPD_Skims::radius, relativeConstraints::ring, LASGlobalLoop::TEC2TECLoop(), LASGlobalLoop::TECLoop(), theTrackerGeometry, theZ, and LASGlobalLoop::TIBTOBLoop().

Member Data Documentation

◆ collectedDataProfiles

LASGlobalData<LASModuleProfile> LaserAlignment::collectedDataProfiles
private

Definition at line 208 of file LaserAlignment.h.

Referenced by beginJob(), endRunProduce(), and produce().

◆ currentDataProfiles

LASGlobalData<LASModuleProfile> LaserAlignment::currentDataProfiles
private

data profiles for the current event

Definition at line 205 of file LaserAlignment.h.

Referenced by beginJob(), fillDataProfiles(), and produce().

◆ detectorId

LASGlobalData<unsigned int> LaserAlignment::detectorId
private

◆ enableJudgeZeroFilter

bool LaserAlignment::enableJudgeZeroFilter
private

config switch

Definition at line 155 of file LaserAlignment.h.

Referenced by LaserAlignment().

◆ firstEvent_

bool LaserAlignment::firstEvent_
private

Definition at line 244 of file LaserAlignment.h.

Referenced by beginJob(), and produce().

◆ gD

edm::ESHandle<GeometricDet> LaserAlignment::gD
private

tracker geometry;

Definition at line 236 of file LaserAlignment.h.

Referenced by produce().

◆ geomDetToken_

const edm::ESGetToken<GeometricDet, IdealGeometryRecord> LaserAlignment::geomDetToken_
private

Definition at line 133 of file LaserAlignment.h.

Referenced by produce().

◆ geomToken_

const edm::ESGetToken<TrackerGeometry, TrackerDigiGeometryRecord> LaserAlignment::geomToken_
private

Definition at line 132 of file LaserAlignment.h.

Referenced by produce().

◆ gprToken_

const edm::ESGetToken<Alignments, GlobalPositionRcd> LaserAlignment::gprToken_
private

Definition at line 136 of file LaserAlignment.h.

Referenced by produce().

◆ isAcceptedProfile

LASGlobalData<int> LaserAlignment::isAcceptedProfile
private

Definition at line 218 of file LaserAlignment.h.

Referenced by beginJob(), isATBeam(), isTECBeam(), and produce().

◆ judge

LASProfileJudge LaserAlignment::judge
private

Definition at line 190 of file LaserAlignment.h.

Referenced by LaserAlignment(), and produce().

◆ judgeOverdriveThreshold

unsigned int LaserAlignment::judgeOverdriveThreshold
private

config parameters for the LASProfileJudge

Definition at line 158 of file LaserAlignment.h.

Referenced by LaserAlignment().

◆ misalignedByRefGeometry

bool LaserAlignment::misalignedByRefGeometry
private

config switch

Definition at line 164 of file LaserAlignment.h.

Referenced by endRunProduce(), and LaserAlignment().

◆ moduleLoop

LASGlobalLoop LaserAlignment::moduleLoop
private

◆ nominalCoordinates

LASGlobalData<LASCoordinateSet> LaserAlignment::nominalCoordinates
private

◆ numberOfAcceptedProfiles

LASGlobalData<int> LaserAlignment::numberOfAcceptedProfiles
private

Definition at line 214 of file LaserAlignment.h.

Referenced by beginJob(), DumpHitmaps(), endRunProduce(), and produce().

◆ peakFinderThreshold

double LaserAlignment::peakFinderThreshold
private

config parameter

Definition at line 152 of file LaserAlignment.h.

Referenced by endRunProduce(), and LaserAlignment().

◆ pedestalProfiles

LASGlobalData<LASModuleProfile> LaserAlignment::pedestalProfiles
private

Definition at line 202 of file LaserAlignment.h.

Referenced by beginJob(), fillPedestalProfiles(), and produce().

◆ ptitpToken_

Definition at line 135 of file LaserAlignment.h.

Referenced by produce().

◆ ptpToken_

const edm::ESGetToken<PTrackerParameters, PTrackerParametersRcd> LaserAlignment::ptpToken_
private

Definition at line 134 of file LaserAlignment.h.

Referenced by produce().

◆ singleModulesDir

TDirectory* LaserAlignment::singleModulesDir
private

Definition at line 233 of file LaserAlignment.h.

Referenced by beginJob().

◆ stripPedestalsToken_

const edm::ESGetToken<SiStripPedestals, SiStripPedestalsRcd> LaserAlignment::stripPedestalsToken_
private

Definition at line 137 of file LaserAlignment.h.

Referenced by produce().

◆ summedHistograms

LASGlobalData<TH1D*> LaserAlignment::summedHistograms
private

Definition at line 222 of file LaserAlignment.h.

Referenced by beginJob(), and endRunProduce().

◆ tecDoubleHitDetId

std::vector<unsigned int> LaserAlignment::tecDoubleHitDetId
private

Definition at line 199 of file LaserAlignment.h.

Referenced by fillDetectorId(), and produce().

◆ theAlignableTracker

AlignableTracker* LaserAlignment::theAlignableTracker
private

Definition at line 240 of file LaserAlignment.h.

Referenced by endRunProduce(), produce(), and ~LaserAlignment().

◆ theAlignRecordName

std::string LaserAlignment::theAlignRecordName
private

Definition at line 242 of file LaserAlignment.h.

Referenced by endRunProduce().

◆ theApplyBeamKinkCorrections

bool LaserAlignment::theApplyBeamKinkCorrections
private

config switch

Definition at line 149 of file LaserAlignment.h.

Referenced by endRunProduce(), and LaserAlignment().

◆ theCompression

int LaserAlignment::theCompression
private

config parameter (histograms file compression level)

Definition at line 176 of file LaserAlignment.h.

Referenced by beginJob(), and LaserAlignment().

◆ theDigiProducersList

std::vector<edm::ParameterSet> LaserAlignment::theDigiProducersList
private

Definition at line 170 of file LaserAlignment.h.

Referenced by fillDataProfiles().

◆ theDoPedestalSubtraction

bool LaserAlignment::theDoPedestalSubtraction
private

config switch

Definition at line 143 of file LaserAlignment.h.

Referenced by LaserAlignment(), and produce().

◆ theErrorRecordName

std::string LaserAlignment::theErrorRecordName
private

Definition at line 242 of file LaserAlignment.h.

Referenced by endRunProduce().

◆ theEvents

int LaserAlignment::theEvents
private

counter for the total number of events processed

Definition at line 140 of file LaserAlignment.h.

Referenced by endRunProduce(), and produce().

◆ theFile

TFile* LaserAlignment::theFile
private

Tree stuff.

Definition at line 232 of file LaserAlignment.h.

Referenced by beginJob(), and ~LaserAlignment().

◆ theFileName

std::string LaserAlignment::theFileName
private

config parameter (histograms file output name)

Definition at line 179 of file LaserAlignment.h.

Referenced by beginJob(), and LaserAlignment().

◆ theGlobalPositionRcd

edm::ESHandle<Alignments> LaserAlignment::theGlobalPositionRcd
private

Definition at line 238 of file LaserAlignment.h.

Referenced by produce().

◆ theLasConstants

LASConstants LaserAlignment::theLasConstants
private

Definition at line 193 of file LaserAlignment.h.

Referenced by endRunProduce().

◆ theMaskAtModules

std::vector<unsigned int> LaserAlignment::theMaskAtModules
private

Definition at line 183 of file LaserAlignment.h.

Referenced by ApplyATMaskingCorrections(), endRunProduce(), and LaserAlignment().

◆ theMaskTecModules

std::vector<unsigned int> LaserAlignment::theMaskTecModules
private

config parameters

Definition at line 182 of file LaserAlignment.h.

Referenced by ApplyEndcapMaskingCorrections(), endRunProduce(), and LaserAlignment().

◆ theProfileNames

LASGlobalData<std::string> LaserAlignment::theProfileNames
private

Definition at line 211 of file LaserAlignment.h.

Referenced by beginJob(), and produce().

◆ theSaveHistograms

bool LaserAlignment::theSaveHistograms
private

config switch

Definition at line 173 of file LaserAlignment.h.

Referenced by beginJob(), LaserAlignment(), and ~LaserAlignment().

◆ theSetNominalStrips

bool LaserAlignment::theSetNominalStrips
private

config switch

Definition at line 186 of file LaserAlignment.h.

Referenced by endRunProduce(), and LaserAlignment().

◆ theStoreToDB

bool LaserAlignment::theStoreToDB
private

config switch

Definition at line 167 of file LaserAlignment.h.

Referenced by endRunProduce(), and LaserAlignment().

◆ theTrackerGeometry

edm::ESHandle<TrackerGeometry> LaserAlignment::theTrackerGeometry
private

Definition at line 237 of file LaserAlignment.h.

Referenced by endRunProduce(), produce(), and testRoutine().

◆ theUseMinuitAlgorithm

bool LaserAlignment::theUseMinuitAlgorithm
private

config switch

Definition at line 146 of file LaserAlignment.h.

Referenced by endRunProduce(), and LaserAlignment().

◆ topoToken_

const edm::ESGetToken<TrackerTopology, TrackerTopologyRcd> LaserAlignment::topoToken_
private

Tokens for ESconsumes.

Definition at line 131 of file LaserAlignment.h.

Referenced by produce().

◆ updateFromInputGeometry

bool LaserAlignment::updateFromInputGeometry
private

config switch

Definition at line 161 of file LaserAlignment.h.

Referenced by endRunProduce(), LaserAlignment(), and produce().

LASGlobalData::SetTECEntry
void SetTECEntry(int subdetector, int tecRing, int beam, int tecDisk, T)
Definition: LASGlobalData.h:150
SiStripLaserRecHit2D
Definition: SiStripLaserRecHit2D.h:12
LaserAlignment::pedestalProfiles
LASGlobalData< LASModuleProfile > pedestalProfiles
Definition: LaserAlignment.h:202
LaserAlignment::CalculateNominalCoordinates
void CalculateNominalCoordinates(void)
fills a LASGlobalData<LASCoordinateSet> with nominal module positions
Definition: LaserAlignment.cc:1331
LaserAlignment::theUseMinuitAlgorithm
bool theUseMinuitAlgorithm
config switch
Definition: LaserAlignment.h:146
LaserAlignment::theSaveHistograms
bool theSaveHistograms
config switch
Definition: LaserAlignment.h:173
LASGlobalLoop::TIBTOBLoop
bool TIBTOBLoop(int &, int &, int &) const
Definition: LASGlobalLoop.cc:46
cond::service::PoolDBOutputService::beginOfTime
cond::Time_t beginOfTime() const
Definition: PoolDBOutputService.cc:215
PTrackerParameters
Definition: PTrackerParameters.h:6
edm::DetSetVector::end
iterator end()
Return the off-the-end iterator.
Definition: DetSetVector.h:325
LASEndcapAlignmentParameterSet
Definition: LASEndcapAlignmentParameterSet.h:25
SiStripPedestals::Range
std::pair< ContainerIterator, ContainerIterator > Range
Definition: SiStripPedestals.h:51
EcnaPython_AdcPeg12_S1_10_R170298_1_0_150_Dee0.digiProducer
digiProducer
Definition: EcnaPython_AdcPeg12_S1_10_R170298_1_0_150_Dee0.py:50
LASProfileJudge::SetOverdriveThreshold
void SetOverdriveThreshold(unsigned int)
Definition: LASProfileJudge.cc:90
LaserAlignment::ApplyATMaskingCorrections
void ApplyATMaskingCorrections(LASGlobalData< LASCoordinateSet > &, LASGlobalData< LASCoordinateSet > &, LASBarrelAlignmentParameterSet &)
same for alignment tube modules
Definition: LaserAlignment.cc:1624
TrackerGeomBuilderFromGeometricDet::build
TrackerGeometry * build(const GeometricDet *gd, const PTrackerAdditionalParametersPerDet *ptitp, const PTrackerParameters &ptp, const TrackerTopology *tTopo)
Definition: TrackerGeomBuilderFromGeometricDet.cc:44
LaserAlignment::theFile
TFile * theFile
Tree stuff.
Definition: LaserAlignment.h:232
TrackerTopology
Definition: TrackerTopology.h:16
digitizers_cfi.strip
strip
Definition: digitizers_cfi.py:19
LASBarrelAlgorithm::CalculateParameters
LASBarrelAlignmentParameterSet CalculateParameters(LASGlobalData< LASCoordinateSet > &, LASGlobalData< LASCoordinateSet > &)
Definition: LASBarrelAlgorithm.cc:20
gather_cfg.cout
cout
Definition: gather_cfg.py:144
pos
Definition: PixelAliasList.h:18
LaserAlignment::isTECBeam
bool isTECBeam(void)
decide whether TEC or AT beams have fired
Definition: LaserAlignment.cc:1224
PTrackerAdditionalParametersPerDet
Definition: PTrackerAdditionalParametersPerDet.h:9
LASGlobalData< LASCoordinateSet >
LASProfileJudge::JudgeProfile
bool JudgeProfile(const LASModuleProfile &, double)
Definition: LASProfileJudge.cc:45
edm::DetSetVector::begin
iterator begin()
Return an iterator to the first DetSet.
Definition: DetSetVector.h:314
LaserAlignment::geomToken_
const edm::ESGetToken< TrackerGeometry, TrackerDigiGeometryRecord > geomToken_
Definition: LaserAlignment.h:132
LaserAlignment::gD
edm::ESHandle< GeometricDet > gD
tracker geometry;
Definition: LaserAlignment.h:236
LASGlobalLoop
Definition: LASGlobalLoop.h:24
LaserAlignment::theFileName
std::string theFileName
config parameter (histograms file output name)
Definition: LaserAlignment.h:179
LaserAlignment::summedHistograms
LASGlobalData< TH1D * > summedHistograms
Definition: LaserAlignment.h:222
LASProfileJudge::EnableZeroFilter
void EnableZeroFilter(bool)
Definition: LASProfileJudge.cc:79
LaserAlignment::isAcceptedProfile
LASGlobalData< int > isAcceptedProfile
Definition: LaserAlignment.h:218
spr::find
void find(edm::Handle< EcalRecHitCollection > &hits, DetId thisDet, std::vector< EcalRecHitCollection::const_iterator > &hit, bool debug=false)
Definition: FindCaloHit.cc:19
edm::Handle
Definition: AssociativeIterator.h:50
edm::Service::isAvailable
bool isAvailable() const
Definition: Service.h:40
LaserAlignment::theMaskTecModules
std::vector< unsigned int > theMaskTecModules
config parameters
Definition: LaserAlignment.h:182
LASEndcapAlgorithm::GetAlignmentParameterCorrection
double GetAlignmentParameterCorrection(int, int, int, int, LASGlobalData< LASCoordinateSet > &, LASEndcapAlignmentParameterSet &)
Definition: LASEndcapAlgorithm.cc:312
LaserAlignment::theProfileNames
LASGlobalData< std::string > theProfileNames
Definition: LaserAlignment.h:211
theZ
T theZ
Definition: Basic3DVectorLD.h:243
LaserAlignment::theAlignableTracker
AlignableTracker * theAlignableTracker
Definition: LaserAlignment.h:240
LASCoordinateSet::SetPhiError
void SetPhiError(double aPhiError)
Definition: LASCoordinateSet.h:32
DetId
Definition: DetId.h:17
TkLasBeam
Definition: TkLasBeam.h:12
SiStripRawDigi
A Digi for the silicon strip detector, containing only adc information, and suitable for storing raw ...
Definition: SiStripRawDigi.h:15
LASModuleProfile::SetValue
void SetValue(unsigned int theStripNumber, const double &theValue)
Definition: LASModuleProfile.h:20
LASGeometryUpdater
Definition: LASGeometryUpdater.h:16
edm::Run::put
void put(std::unique_ptr< PROD > product)
Put a new product.
Definition: Run.h:109
LaserAlignment::theApplyBeamKinkCorrections
bool theApplyBeamKinkCorrections
config switch
Definition: LaserAlignment.h:149
LaserAlignment::geomDetToken_
const edm::ESGetToken< GeometricDet, IdealGeometryRecord > geomDetToken_
Definition: LaserAlignment.h:133
AlignableTracker::alignmentErrors
AlignmentErrorsExtended * alignmentErrors() const override
Return alignment errors, sorted by DetId.
Definition: AlignableTracker.cc:59
SiStripRawDigi::adc
uint16_t adc() const
Definition: SiStripRawDigi.h:22
Geom::Cylindrical2Cartesian
Definition: CoordinateSets.h:34
LaserAlignment::numberOfAcceptedProfiles
LASGlobalData< int > numberOfAcceptedProfiles
Definition: LaserAlignment.h:214
LaserAlignment::singleModulesDir
TDirectory * singleModulesDir
Definition: LaserAlignment.h:233
LaserAlignment::theAlignRecordName
std::string theAlignRecordName
Definition: LaserAlignment.h:242
LaserAlignment::enableJudgeZeroFilter
bool enableJudgeZeroFilter
config switch
Definition: LaserAlignment.h:155
edm::ESHandle
Definition: DTSurvey.h:22
AlignableTracker
Definition: AlignableTracker.h:17
SiStripDigi::adc
const uint16_t & adc() const
Definition: SiStripDigi.h:34
LASGlobalData::GetTECEntry
T & GetTECEntry(int subdetector, int tecRing, int beam, int tecDisk)
Definition: LASGlobalData.h:84
GeometricDet
Definition: GeometricDet.h:31
LASPeakFinder::SetAmplitudeThreshold
void SetAmplitudeThreshold(double)
Definition: LASPeakFinder.cc:106
EcalCondDBWriter_cfi.beam
beam
Definition: EcalCondDBWriter_cfi.py:45
LASAlignmentTubeAlgorithm::GetTIBTOBAlignmentParameterCorrection
double GetTIBTOBAlignmentParameterCorrection(int, int, int, LASGlobalData< LASCoordinateSet > &, LASBarrelAlignmentParameterSet &)
Definition: LASAlignmentTubeAlgorithm.cc:490
Point3DBase< float, GlobalTag >
LaserAlignment::fillDetectorId
void fillDetectorId(void)
fill hard coded detIds
Definition: LaserAlignmentFillDetId.cc:7
first
auto first
Definition: CAHitNtupletGeneratorKernelsImpl.h:125
edm::EventID::run
RunNumber_t run() const
Definition: EventID.h:38
SiStripPedestals::getRange
const Range getRange(const uint32_t &detID) const
Definition: SiStripPedestals.cc:28
LASModuleProfile::SetAllValuesTo
void SetAllValuesTo(const double &)
Definition: LASModuleProfile.cc:76
LASPeakFinder::FindPeakIn
bool FindPeakIn(const LASModuleProfile &, std::pair< double, double > &, TH1D *, const double)
Definition: LASPeakFinder.cc:16
runTauDisplay.gp
gp
Definition: runTauDisplay.py:431
SiStripDigi::strip
const uint16_t & strip() const
Definition: SiStripDigi.h:33
LaserAlignment::moduleLoop
LASGlobalLoop moduleLoop
Definition: LaserAlignment.h:229
LaserAlignment::gprToken_
const edm::ESGetToken< Alignments, GlobalPositionRcd > gprToken_
Definition: LaserAlignment.h:136
LogDebug
#define LogDebug(id)
Definition: MessageLogger.h:233
LaserAlignment::theSetNominalStrips
bool theSetNominalStrips
config switch
Definition: LaserAlignment.h:186
LaserAlignment::theCompression
int theCompression
config parameter (histograms file compression level)
Definition: LaserAlignment.h:176
LASAlignmentTubeAlgorithm::CalculateParameters
LASBarrelAlignmentParameterSet CalculateParameters(LASGlobalData< LASCoordinateSet > &, LASGlobalData< LASCoordinateSet > &)
Definition: LASAlignmentTubeAlgorithm.cc:12
LaserAlignment::misalignedByRefGeometry
bool misalignedByRefGeometry
config switch
Definition: LaserAlignment.h:164
LASCoordinateSet::GetPhiError
double GetPhiError(void) const
Definition: LASCoordinateSet.h:19
PV3DBase::barePhi
T barePhi() const
Definition: PV3DBase.h:65
LaserAlignment::getTIBTOBNominalBeamOffset
double getTIBTOBNominalBeamOffset(unsigned int, unsigned int, unsigned int)
returns the nominal beam position (strips) in TOB for the profileJudge
Definition: LaserAlignment.cc:1278
LASCoordinateSet
Definition: LASCoordinateSet.h:12
LaserAlignment::theStoreToDB
bool theStoreToDB
config switch
Definition: LaserAlignment.h:167
edm::DetSetVector::const_iterator
collection_type::const_iterator const_iterator
Definition: DetSetVector.h:102
heppy_loop.loop
loop
Definition: heppy_loop.py:28
LaserAlignment::ApplyEndcapMaskingCorrections
void ApplyEndcapMaskingCorrections(LASGlobalData< LASCoordinateSet > &, LASGlobalData< LASCoordinateSet > &, LASEndcapAlignmentParameterSet &)
apply endcap correction to masked modules in TEC
Definition: LaserAlignment.cc:1584
LaserAlignment::updateFromInputGeometry
bool updateFromInputGeometry
config switch
Definition: LaserAlignment.h:161
edm::EventID::event
EventNumber_t event() const
Definition: EventID.h:40
LASBarrelAlignmentParameterSet
Definition: LASBarrelAlignmentParameterSet.h:23
edm::Service< cond::service::PoolDBOutputService >
createfilelist.int
int
Definition: createfilelist.py:10
LASEndcapAlignmentParameterSet::Print
void Print(void)
Definition: LASEndcapAlignmentParameterSet.cc:158
LaserAlignment::firstEvent_
bool firstEvent_
Definition: LaserAlignment.h:244
LaserAlignment::peakFinderThreshold
double peakFinderThreshold
config parameter
Definition: LaserAlignment.h:152
LaserAlignment::ptitpToken_
const edm::ESGetToken< PTrackerAdditionalParametersPerDet, PTrackerAdditionalParametersPerDetRcd > ptitpToken_
Definition: LaserAlignment.h:135
LaserAlignment::judgeOverdriveThreshold
unsigned int judgeOverdriveThreshold
config parameters for the LASProfileJudge
Definition: LaserAlignment.h:158
LASGlobalData::GetTIBTOBEntry
T & GetTIBTOBEntry(int subdetector, int beam, int tibTobPosition)
Definition: LASGlobalData.h:107
M_PI
#define M_PI
Definition: BXVectorInputProducer.cc:49
LASGlobalLoop::TEC2TECLoop
bool TEC2TECLoop(int &, int &, int &) const
Definition: LASGlobalLoop.cc:74
LaserAlignment::isATBeam
bool isATBeam(void)
Definition: LaserAlignment.cc:1251
LASBarrelAlgorithm
Definition: LASBarrelAlgorithm.h:22
AlignmentErrorsExtended
Definition: AlignmentErrorsExtended.h:10
LaserAlignment::detectorId
LASGlobalData< unsigned int > detectorId
Definition: LaserAlignment.h:196
LaserAlignment::currentDataProfiles
LASGlobalData< LASModuleProfile > currentDataProfiles
data profiles for the current event
Definition: LaserAlignment.h:205
LaserAlignment::DumpHitmaps
void DumpHitmaps(LASGlobalData< int > &)
for debugging only, will disappear
Definition: LaserAlignment.cc:1530
AlCaHLTBitMon_QueryRunRegistry.string
string string
Definition: AlCaHLTBitMon_QueryRunRegistry.py:256
LaserAlignment::theDoPedestalSubtraction
bool theDoPedestalSubtraction
config switch
Definition: LaserAlignment.h:143
LASGlobalLoop::TECLoop
bool TECLoop(int &, int &, int &, int &) const
Definition: LASGlobalLoop.cc:13
LaserAlignment::theGlobalPositionRcd
edm::ESHandle< Alignments > theGlobalPositionRcd
Definition: LaserAlignment.h:238
LaserAlignment::fillDataProfiles
void fillDataProfiles(edm::Event const &, edm::EventSetup const &)
fill profiles from SiStrip(Raw)Digi container
Definition: LaserAlignment.cc:940
DataMixerDataOnData_cff.digiLabel
digiLabel
Definition: DataMixerDataOnData_cff.py:46
LASGlobalData::SetTEC2TECEntry
void SetTEC2TECEntry(int subdetector, int beam, int tecDisk, T)
Definition: LASGlobalData.h:195
LaserAlignment::theEvents
int theEvents
counter for the total number of events processed
Definition: LaserAlignment.h:140
eostools.move
def move(src, dest)
Definition: eostools.py:511
LASGlobalData::GetTEC2TECEntry
T & GetTEC2TECEntry(int subdetector, int beam, int tecDisk)
Definition: LASGlobalData.h:129
AlignableTracker::alignments
Alignments * alignments() const override
Return alignments, sorted by DetId.
Definition: AlignableTracker.cc:42
LASEndcapAlgorithm::CalculateParameters
LASEndcapAlignmentParameterSet CalculateParameters(LASGlobalData< LASCoordinateSet > &, LASGlobalData< LASCoordinateSet > &)
Definition: LASEndcapAlgorithm.cc:15
LaserAlignment::getTEC2TECNominalBeamOffset
double getTEC2TECNominalBeamOffset(unsigned int, unsigned int, unsigned int)
returns the nominal beam position (strips) in TEC (AT) for the profileJudge
Definition: LaserAlignment.cc:1313
LASAlignmentTubeAlgorithm
Definition: LASAlignmentTubeAlgorithm.h:19
LaserAlignment::judge
LASProfileJudge judge
Definition: LaserAlignment.h:190
LaserAlignment::stripPedestalsToken_
const edm::ESGetToken< SiStripPedestals, SiStripPedestalsRcd > stripPedestalsToken_
Definition: LaserAlignment.h:137
LaserAlignment::theTrackerGeometry
edm::ESHandle< TrackerGeometry > theTrackerGeometry
Definition: LaserAlignment.h:237
SiStripOfflineCRack_cfg.alias
alias
Definition: SiStripOfflineCRack_cfg.py:128
Exception
Definition: hltDiff.cc:245
cond::service::PoolDBOutputService::writeOne
Hash writeOne(const T *payload, Time_t time, const std::string &recordName)
Definition: PoolDBOutputService.h:63
edm::EventBase::id
edm::EventID id() const
Definition: EventBase.h:59
LaserAlignment::topoToken_
const edm::ESGetToken< TrackerTopology, TrackerTopologyRcd > topoToken_
Tokens for ESconsumes.
Definition: LaserAlignment.h:131
LaserAlignment::tecDoubleHitDetId
std::vector< unsigned int > tecDoubleHitDetId
Definition: LaserAlignment.h:199
relativeConstraints.ring
ring
Definition: relativeConstraints.py:68
CosmicsPD_Skims.radius
radius
Definition: CosmicsPD_Skims.py:135
LaserAlignment::nominalCoordinates
LASGlobalData< LASCoordinateSet > nominalCoordinates
Definition: LaserAlignment.h:225
angle
T angle(T x1, T y1, T z1, T x2, T y2, T z2)
Definition: angle.h:11
or
The Signals That Services Can Subscribe To This is based on ActivityRegistry and is current per Services can connect to the signals distributed by the ActivityRegistry in order to monitor the activity of the application Each possible callback has some defined which we here list in angle e< void, edm::EventID const &, edm::Timestamp const & > We also list in braces which AR_WATCH_USING_METHOD_ is used for those or
Definition: Activities.doc:12
LASProfileJudge::IsSignalIn
bool IsSignalIn(const LASModuleProfile &, double)
Definition: LASProfileJudge.cc:24
LASGlobalData::SetTIBTOBEntry
void SetTIBTOBEntry(int subdetector, int beam, int tibTobPosition, T)
Definition: LASGlobalData.h:173
LASEndcapAlgorithm
Definition: LASEndcapAlgorithm.h:25
edm::EDConsumerBase::esConsumes
auto esConsumes()
Definition: EDConsumerBase.h:206
TrackerGeomBuilderFromGeometricDet
Definition: TrackerGeomBuilderFromGeometricDet.h:18
LASCoordinateSet::GetPhi
double GetPhi(void) const
Definition: LASCoordinateSet.h:18
SiStripDigi
A Digi for the silicon strip detector, containing both strip and adc information, and suitable for st...
Definition: SiStripDigi.h:12
cms::Exception
Definition: Exception.h:70
LaserAlignment::theErrorRecordName
std::string theErrorRecordName
Definition: LaserAlignment.h:242
SiStripPedestals::getPed
float getPed(const uint16_t &strip, const Range &range) const
Definition: SiStripPedestals.cc:51
LaserAlignment::fillPedestalProfiles
void fillPedestalProfiles(edm::ESHandle< SiStripPedestals > &)
fill pedestals from dbase
Definition: LaserAlignment.cc:1172
SiStripDetId
Detector identifier class for the strip tracker.
Definition: SiStripDetId.h:18
LASAlignmentTubeAlgorithm::GetTEC2TECAlignmentParameterCorrection
double GetTEC2TECAlignmentParameterCorrection(int, int, int, LASGlobalData< LASCoordinateSet > &, LASBarrelAlignmentParameterSet &)
Definition: LASAlignmentTubeAlgorithm.cc:609
LaserAlignment::ConvertAngle
double ConvertAngle(double)
convert an angle in the [-pi,pi] range to the [0,2*pi] range
Definition: LaserAlignment.cc:1425
LaserAlignment::theMaskAtModules
std::vector< unsigned int > theMaskAtModules
Definition: LaserAlignment.h:183
HLT_FULL_cff.distance
distance
Definition: HLT_FULL_cff.py:7746
align_cfg.iteration
iteration
Definition: align_cfg.py:5
LaserAlignment::theDigiProducersList
std::vector< edm::ParameterSet > theDigiProducersList
Definition: LaserAlignment.h:170
Alignments
Definition: Alignments.h:10
LASPeakFinder
Definition: LASPeakFinder.h:19
LaserAlignment::collectedDataProfiles
LASGlobalData< LASModuleProfile > collectedDataProfiles
Definition: LaserAlignment.h:208
LaserAlignment::ptpToken_
const edm::ESGetToken< PTrackerParameters, PTrackerParametersRcd > ptpToken_
Definition: LaserAlignment.h:134
LaserAlignment::theLasConstants
LASConstants theLasConstants
Definition: LaserAlignment.h:193
LASCoordinateSet::SetPhi
void SetPhi(double aPhi)
Definition: LASCoordinateSet.h:27
StripGeomDetUnit
Definition: StripGeomDetUnit.h:15
TrackerGeometry
Definition: TrackerGeometry.h:14
LASBarrelAlignmentParameterSet::Print
void Print(void)
Definition: LASBarrelAlignmentParameterSet.cc:94
edm::DetSet::const_iterator
collection_type::const_iterator const_iterator
Definition: DetSet.h:31