CMS 3D CMS Logo

AlignmentProducer.cc
Go to the documentation of this file.
1 
5 #include "AlignmentProducer.h"
6 
8 
11 
12 //------------------------------------------------------------------------------
14  : AlignmentProducerBase{config}, maxLoops_{config.getUntrackedParameter<unsigned int>("maxLoops")} {
15  edm::LogInfo("Alignment") << "@SUB=AlignmentProducer::AlignmentProducer";
16 
17  // Tell the framework what data is being produced
18  if (doTracker_) {
19  setWhatProduced(this, &AlignmentProducer::produceTracker);
20  }
21 }
22 
23 //------------------------------------------------------------------------------
24 std::shared_ptr<TrackerGeometry> AlignmentProducer::produceTracker(const TrackerDigiGeometryRecord &) {
25  edm::LogInfo("Alignment") << "@SUB=AlignmentProducer::produceTracker";
26  return trackerGeometry_;
27 }
28 
29 //------------------------------------------------------------------------------
31  edm::LogInfo("Alignment") << "@SUB=AlignmentProducer::beginOfJob";
32  initAlignmentAlgorithm(iSetup);
33 }
34 
35 //------------------------------------------------------------------------------
37  edm::LogInfo("Alignment") << "@SUB=AlignmentProducer::endOfJob";
38 
39  if (!finish()) {
40  edm::LogError("Alignment") << "@SUB=AlignmentProducer::endOfJob"
41  << "Did not process any events in last loop, do not dare to store to DB.";
42  }
43 }
44 
45 //------------------------------------------------------------------------------
46 void AlignmentProducer::startingNewLoop(unsigned int iLoop) {
47  edm::LogInfo("Alignment") << "@SUB=AlignmentProducer::startingNewLoop"
48  << "Starting loop number " << iLoop;
50 }
51 
52 //------------------------------------------------------------------------------
54  if (0 == nEvent()) {
55  // beginOfJob is usually called by the framework in the first event of the first loop
56  // (a hack: beginOfJob needs the EventSetup that is not well defined without an event)
57  // and the algorithms rely on the initialisations done in beginOfJob. We cannot call
58  // this->beginOfJob(iSetup); here either since that will access the EventSetup to get
59  // some geometry information that is not defined either without having seen an event.
60  edm::LogError("Alignment") << "@SUB=AlignmentProducer::endOfLoop"
61  << "Did not process any events in loop " << iLoop
62  << ", stop processing without terminating algorithm.";
63  return kStop;
64  }
65 
66  edm::LogInfo("Alignment") << "@SUB=AlignmentProducer::endOfLoop"
67  << "Ending loop " << iLoop << ", terminating algorithm.";
68  terminateProcessing(&iSetup);
69 
70  if (iLoop == maxLoops_ - 1 || iLoop >= maxLoops_)
71  return kStop;
72  else
73  return kContinue;
74 }
75 
76 //------------------------------------------------------------------------------
78  if (processEvent(event, setup))
79  return kContinue;
80  else
81  return kStop;
82 }
83 
84 //------------------------------------------------------------------------------
86 
87 //------------------------------------------------------------------------------
89 
90 //------------------------------------------------------------------------------
92  beginLuminosityBlockImpl(lumiBlock, setup);
93 }
94 
95 //------------------------------------------------------------------------------
97  endLuminosityBlockImpl(lumiBlock, setup);
98 }
99 
AlignmentProducerBase::initAlignmentAlgorithm
void initAlignmentAlgorithm(const edm::EventSetup &, bool update=false)
Definition: AlignmentProducerBase.cc:341
edm::EDLooperBase::Status
Status
Definition: EDLooperBase.h:80
AlignmentProducerBase::beginLuminosityBlockImpl
void beginLuminosityBlockImpl(const edm::LuminosityBlock &, const edm::EventSetup &)
begin lumi block
Definition: AlignmentProducerBase.cc:247
AlignmentProducer::maxLoops_
const unsigned int maxLoops_
Definition: AlignmentProducer.h:60
AlignmentProducerBase::endRunImpl
void endRunImpl(const edm::Run &, const edm::EventSetup &)
end run
Definition: AlignmentProducerBase.cc:231
AlignmentProducerBase::endLuminosityBlockImpl
void endLuminosityBlockImpl(const edm::LuminosityBlock &, const edm::EventSetup &)
end lumi block
Definition: AlignmentProducerBase.cc:253
edm::LuminosityBlock
Definition: LuminosityBlock.h:50
AlignmentProducer::duringLoop
Status duringLoop(const edm::Event &, const edm::EventSetup &) override
Called at each event.
Definition: AlignmentProducer.cc:77
edm::Run
Definition: Run.h:45
AlignmentProducerBase::nEvent
int nEvent() const
Definition: AlignmentProducerBase.h:99
edm::LogInfo
Log< level::Info, false > LogInfo
Definition: MessageLogger.h:125
AlignmentProducer
Definition: AlignmentProducer.h:15
DEFINE_FWK_LOOPER
#define DEFINE_FWK_LOOPER(type)
Definition: LooperFactory.h:108
singleTopDQM_cfi.setup
setup
Definition: singleTopDQM_cfi.py:37
AlignmentProducer::startingNewLoop
void startingNewLoop(unsigned int iLoop) override
Called at beginning of loop.
Definition: AlignmentProducer.cc:46
AlignmentProducerBase::trackerGeometry_
std::shared_ptr< TrackerGeometry > trackerGeometry_
Definition: AlignmentProducerBase.h:115
config
Definition: config.py:1
AlignmentProducer::AlignmentProducer
AlignmentProducer(const edm::ParameterSet &)
Constructor.
Definition: AlignmentProducer.cc:13
edm::EDLooperBase::kStop
Definition: EDLooperBase.h:80
AlignmentProducer::beginLuminosityBlock
void beginLuminosityBlock(const edm::LuminosityBlock &, const edm::EventSetup &) override
Called at lumi block start, calling algorithm's beginLuminosityBlock.
Definition: AlignmentProducer.cc:91
TrackerDigiGeometryRecord
Definition: TrackerDigiGeometryRecord.h:15
AlignmentProducerBase
Definition: AlignmentProducerBase.h:70
AlignmentProducerBase::finish
bool finish()
Definition: AlignmentProducerBase.cc:751
LooperFactory.h
TrackerDigiGeometryRecord.h
AlignmentProducerBase::processEvent
bool processEvent(const edm::Event &, const edm::EventSetup &)
Process event.
Definition: AlignmentProducerBase.cc:133
edm::ParameterSet
Definition: ParameterSet.h:47
AlignmentProducerBase::terminateProcessing
void terminateProcessing(const edm::EventSetup *=nullptr)
Terminate processing of events.
Definition: AlignmentProducerBase.cc:111
AlignmentProducer::endOfLoop
Status endOfLoop(const edm::EventSetup &, unsigned int iLoop) override
Called at end of loop.
Definition: AlignmentProducer.cc:53
AlignmentProducer::endLuminosityBlock
void endLuminosityBlock(const edm::LuminosityBlock &, const edm::EventSetup &) override
Called at lumi block end, calling algorithm's endLuminosityBlock.
Definition: AlignmentProducer.cc:96
edm::EventSetup
Definition: EventSetup.h:58
edm::EDLooperBase::kContinue
Definition: EDLooperBase.h:80
edm::LogError
Log< level::Error, false > LogError
Definition: MessageLogger.h:123
AlignmentProducer::produceTracker
virtual std::shared_ptr< TrackerGeometry > produceTracker(const TrackerDigiGeometryRecord &)
Produce the tracker geometry.
Definition: AlignmentProducer.cc:24
writedatasetfile.run
run
Definition: writedatasetfile.py:27
AlignmentProducer::endRun
void endRun(const edm::Run &, const edm::EventSetup &) override
Called at run end - currently reading TkFittedLasBeam if an InpuTag is given for that.
Definition: AlignmentProducer.cc:88
AlignmentProducer::beginRun
void beginRun(const edm::Run &, const edm::EventSetup &) override
Called at run start and calling algorithms beginRun.
Definition: AlignmentProducer.cc:85
AlignmentProducer.h
MuonGeometryRecord.h
AlignmentProducerBase::startProcessing
void startProcessing()
Start processing of events.
Definition: AlignmentProducerBase.cc:83
event
Definition: event.py:1
edm::Event
Definition: Event.h:73
AlignmentProducerBase::beginRunImpl
void beginRunImpl(const edm::Run &, const edm::EventSetup &)
begin run
Definition: AlignmentProducerBase.cc:204
AlignmentProducer::endOfJob
void endOfJob() override
Called at end of job.
Definition: AlignmentProducer.cc:36
edm::EDLooperBase::beginOfJob
virtual void beginOfJob()
Definition: EDLooperBase.cc:99