File indexing completed on 2024-04-06 11:56:14
0001 #ifndef Alignment_CommonAlignmentProducer_AlignmentProducerAsAnalyzer_h
0002 #define Alignment_CommonAlignmentProducer_AlignmentProducerAsAnalyzer_h
0003
0004
0005
0006
0007
0008
0009
0010
0011
0012
0013
0014
0015
0016
0017
0018
0019
0020
0021
0022 #include "Alignment/CommonAlignmentProducer/interface/AlignmentProducerBase.h"
0023 #include "FWCore/Framework/interface/one/EDProducer.h"
0024 #include "FWCore/Framework/interface/ProcessBlock.h"
0025 #include "FWCore/Framework/interface/Run.h"
0026 #include "DataFormats/Alignment/interface/AlignmentToken.h"
0027
0028 class AlignmentProducerAsAnalyzer : public AlignmentProducerBase,
0029 public edm::one::EDProducer<edm::EndProcessBlockProducer,
0030 edm::one::WatchLuminosityBlocks,
0031 edm::one::WatchRuns,
0032 edm::one::SharedResources,
0033 edm::Accumulator> {
0034
0035 public:
0036
0037 AlignmentProducerAsAnalyzer(const edm::ParameterSet&);
0038
0039
0040 ~AlignmentProducerAsAnalyzer() override = default;
0041
0042
0043
0044
0045 void beginJob() override;
0046 void endJob() override;
0047
0048 void beginRun(const edm::Run&, const edm::EventSetup&) override;
0049 void endRun(const edm::Run&, const edm::EventSetup&) override;
0050
0051 void beginLuminosityBlock(const edm::LuminosityBlock&, const edm::EventSetup&) override;
0052 void endLuminosityBlock(const edm::LuminosityBlock&, const edm::EventSetup&) override;
0053 void endProcessBlockProduce(edm::ProcessBlock& processBlock) override;
0054
0055 void accumulate(const edm::Event&, const edm::EventSetup&) override;
0056
0057 private:
0058 edm::EDPutTokenT<AlignmentToken> token_;
0059 bool getTrajTrackAssociationCollection(const edm::Event&, edm::Handle<TrajTrackAssociationCollection>&) override;
0060 bool getBeamSpot(const edm::Event&, edm::Handle<reco::BeamSpot>&) override;
0061 bool getTkFittedLasBeamCollection(const edm::Run&, edm::Handle<TkFittedLasBeamCollection>&) override;
0062 bool getTsosVectorCollection(const edm::Run&, edm::Handle<TsosVectorCollection>&) override;
0063 bool getAliClusterValueMap(const edm::Event&, edm::Handle<AliClusterValueMap>&) override;
0064
0065 edm::EDGetTokenT<TrajTrackAssociationCollection> tjTkAssociationMapToken_;
0066 edm::EDGetTokenT<reco::BeamSpot> beamSpotToken_;
0067 edm::EDGetTokenT<TkFittedLasBeamCollection> tkLasBeamToken_;
0068 edm::EDGetTokenT<TsosVectorCollection> tsosVectorToken_;
0069 edm::EDGetTokenT<AliClusterValueMap> clusterValueMapToken_;
0070 };
0071
0072
0073 inline bool AlignmentProducerAsAnalyzer::getTrajTrackAssociationCollection(
0074 const edm::Event& event, edm::Handle<TrajTrackAssociationCollection>& result) {
0075 return event.getByToken(tjTkAssociationMapToken_, result);
0076 }
0077
0078
0079 inline bool AlignmentProducerAsAnalyzer::getBeamSpot(const edm::Event& event, edm::Handle<reco::BeamSpot>& result) {
0080 return event.getByToken(beamSpotToken_, result);
0081 }
0082
0083
0084 inline bool AlignmentProducerAsAnalyzer::getTkFittedLasBeamCollection(const edm::Run& run,
0085 edm::Handle<TkFittedLasBeamCollection>& result) {
0086 return run.getByToken(tkLasBeamToken_, result);
0087 }
0088
0089
0090 inline bool AlignmentProducerAsAnalyzer::getTsosVectorCollection(const edm::Run& run,
0091 edm::Handle<TsosVectorCollection>& result) {
0092 return run.getByToken(tsosVectorToken_, result);
0093 }
0094
0095
0096 inline bool AlignmentProducerAsAnalyzer::getAliClusterValueMap(const edm::Event& event,
0097 edm::Handle<AliClusterValueMap>& result) {
0098 return event.getByToken(clusterValueMapToken_, result);
0099 }
0100
0101 #endif