Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2023-10-25 09:31:55

0001 /**
0002  * @package   Alignment/CommonAlignmentProducer
0003  * @file      AlignmentProducerAsAnalyzer.cc
0004  *
0005  * @author    Max Stark (max.stark@cern.ch)
0006  * @date      2015/07/16
0007  */
0008 
0009 /*** Header file ***/
0010 #include "AlignmentProducerAsAnalyzer.h"
0011 
0012 #include "CommonTools/UtilAlgos/interface/TFileService.h"
0013 #include "FWCore/Framework/interface/MakerMacros.h"
0014 
0015 //------------------------------------------------------------------------------
0016 AlignmentProducerAsAnalyzer::AlignmentProducerAsAnalyzer(const edm::ParameterSet& config)
0017     : AlignmentProducerBase(config, consumesCollector()),
0018       token_(produces<AlignmentToken, edm::Transition::EndProcessBlock>()) {
0019   usesResource(TFileService::kSharedResource);
0020 
0021   tjTkAssociationMapToken_ = consumes<TrajTrackAssociationCollection>(tjTkAssociationMapTag_);
0022   beamSpotToken_ = consumes<reco::BeamSpot>(beamSpotTag_);
0023   tkLasBeamToken_ = consumes<TkFittedLasBeamCollection>(tkLasBeamTag_);
0024   tsosVectorToken_ = consumes<TsosVectorCollection>(tkLasBeamTag_);
0025   clusterValueMapToken_ = consumes<AliClusterValueMap>(clusterValueMapTag_);
0026 }
0027 
0028 //------------------------------------------------------------------------------
0029 void AlignmentProducerAsAnalyzer::beginJob() {}
0030 
0031 //------------------------------------------------------------------------------
0032 void AlignmentProducerAsAnalyzer::endJob() {}
0033 
0034 //------------------------------------------------------------------------------
0035 void AlignmentProducerAsAnalyzer::beginRun(const edm::Run& run, const edm::EventSetup& setup) {
0036   beginRunImpl(run, setup);
0037 }
0038 
0039 //------------------------------------------------------------------------------
0040 void AlignmentProducerAsAnalyzer::endRun(const edm::Run& run, const edm::EventSetup& setup) { endRunImpl(run, setup); }
0041 
0042 //------------------------------------------------------------------------------
0043 void AlignmentProducerAsAnalyzer::beginLuminosityBlock(const edm::LuminosityBlock& lumiBlock,
0044                                                        const edm::EventSetup& setup) {
0045   beginLuminosityBlockImpl(lumiBlock, setup);
0046 }
0047 
0048 //------------------------------------------------------------------------------
0049 void AlignmentProducerAsAnalyzer::endLuminosityBlock(const edm::LuminosityBlock& lumiBlock,
0050                                                      const edm::EventSetup& setup) {
0051   endLuminosityBlockImpl(lumiBlock, setup);
0052 }
0053 
0054 void AlignmentProducerAsAnalyzer::endProcessBlockProduce(edm::ProcessBlock& processBlock) {
0055   const AlignmentToken valueToPut{};
0056   processBlock.emplace(token_, valueToPut);
0057 
0058   terminateProcessing();
0059   if (!finish()) {
0060     edm::LogError("Alignment") << "@SUB=AlignmentProducerAsAnalyzer::endJob"
0061                                << "Did not process any events, do not dare to store to DB.";
0062   }
0063 
0064   // message is used by the MillePede log parser to check the end of the job
0065   edm::LogInfo("Alignment") << "@SUB=AlignmentProducerAsAnalyzer::endJob"
0066                             << "Finished alignment producer job.";
0067 }
0068 
0069 //------------------------------------------------------------------------------
0070 void AlignmentProducerAsAnalyzer::accumulate(edm::Event const& event, edm::EventSetup const& setup) {
0071   processEvent(event, setup);
0072 }
0073 
0074 DEFINE_FWK_MODULE(AlignmentProducerAsAnalyzer);