CMS 3D CMS Logo

List of all members | Public Member Functions | Static Public Member Functions | Private Attributes
MTDSoAProducer Class Reference
Inheritance diagram for MTDSoAProducer:
edm::stream::EDProducer<>

Public Member Functions

 MTDSoAProducer (const ParameterSet &pset)
 
void produce (edm::Event &ev, const edm::EventSetup &es) final
 
- Public Member Functions inherited from edm::stream::EDProducer<>
 EDProducer ()=default
 
 EDProducer (const EDProducer &)=delete
 
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
 

Static Public Member Functions

static void fillDescriptions (edm::ConfigurationDescriptions &descriptions)
 

Private Attributes

edm::EDGetTokenT< edm::ValueMap< float > > betaToken_
 
edm::EDGetTokenT< edm::ValueMap< float > > momentumWithMTDToken_
 
edm::EDGetTokenT< edm::ValueMap< float > > MVAQualityToken_
 
edm::EDGetTokenT< edm::ValueMap< float > > pathToken_
 
edm::EDGetTokenT< edm::ValueMap< GlobalPoint > > posInMtdToken_
 
edm::EDGetTokenT< edm::ValueMap< float > > probKToken_
 
edm::EDGetTokenT< edm::ValueMap< float > > probPiToken_
 
edm::EDGetTokenT< edm::ValueMap< float > > probPToken_
 
edm::EDGetTokenT< edm::ValueMap< float > > sigmat0Token_
 
edm::EDGetTokenT< edm::ValueMap< float > > sigmatmtdToken_
 
edm::EDGetTokenT< edm::ValueMap< float > > t0Token_
 
edm::EDGetTokenT< edm::ValueMap< float > > tmtdToken_
 
edm::EDGetTokenT< edm::ValueMap< int > > trackAssocToken_
 
edm::EDGetTokenT< reco::TrackCollectiontracksToken_
 

Additional Inherited Members

- Public Types inherited from edm::stream::EDProducer<>
using CacheTypes = CacheContexts< T... >
 
using GlobalCache = typename CacheTypes::GlobalCache
 
using HasAbility = AbilityChecker< T... >
 
using InputProcessBlockCache = typename CacheTypes::InputProcessBlockCache
 
using LuminosityBlockCache = typename CacheTypes::LuminosityBlockCache
 
using LuminosityBlockContext = LuminosityBlockContextT< LuminosityBlockCache, RunCache, GlobalCache >
 
using LuminosityBlockSummaryCache = typename CacheTypes::LuminosityBlockSummaryCache
 
using RunCache = typename CacheTypes::RunCache
 
using RunContext = RunContextT< RunCache, GlobalCache >
 
using RunSummaryCache = typename CacheTypes::RunSummaryCache
 

Detailed Description

Definition at line 17 of file MTDSoAProducer.cc.

Constructor & Destructor Documentation

◆ MTDSoAProducer()

MTDSoAProducer::MTDSoAProducer ( const ParameterSet pset)

Definition at line 42 of file MTDSoAProducer.cc.

43  : tracksToken_(consumes<reco::TrackCollection>(iConfig.getParameter<edm::InputTag>("tracksSrc"))),
44  trackAssocToken_(consumes<edm::ValueMap<int>>(iConfig.getParameter<edm::InputTag>("trackAssocSrc"))),
45  t0Token_(consumes<edm::ValueMap<float>>(iConfig.getParameter<edm::InputTag>("t0Src"))),
46  sigmat0Token_(consumes<edm::ValueMap<float>>(iConfig.getParameter<edm::InputTag>("sigmat0Src"))),
47  tmtdToken_(consumes<edm::ValueMap<float>>(iConfig.getParameter<edm::InputTag>("tmtdSrc"))),
48  sigmatmtdToken_(consumes<edm::ValueMap<float>>(iConfig.getParameter<edm::InputTag>("sigmatmtdSrc"))),
49  betaToken_(consumes<edm::ValueMap<float>>(iConfig.getParameter<edm::InputTag>("betamtd"))),
50  pathToken_(consumes<edm::ValueMap<float>>(iConfig.getParameter<edm::InputTag>("pathmtd"))),
51  MVAQualityToken_(consumes<edm::ValueMap<float>>(iConfig.getParameter<edm::InputTag>("mvaquality"))),
52  posInMtdToken_(consumes<edm::ValueMap<GlobalPoint>>(iConfig.getParameter<edm::InputTag>("posmtd"))),
53  momentumWithMTDToken_(consumes<edm::ValueMap<float>>(iConfig.getParameter<edm::InputTag>("momentum"))),
54  probPiToken_(consumes<edm::ValueMap<float>>(iConfig.getParameter<edm::InputTag>("probPi"))),
55  probKToken_(consumes<edm::ValueMap<float>>(iConfig.getParameter<edm::InputTag>("probK"))),
56  probPToken_(consumes<edm::ValueMap<float>>(iConfig.getParameter<edm::InputTag>("probP"))) {
57  produces<MtdHostCollection>();
58 }
edm::EDGetTokenT< edm::ValueMap< GlobalPoint > > posInMtdToken_
edm::EDGetTokenT< edm::ValueMap< float > > MVAQualityToken_
edm::EDGetTokenT< edm::ValueMap< float > > probPiToken_
edm::EDGetTokenT< edm::ValueMap< float > > momentumWithMTDToken_
edm::EDGetTokenT< edm::ValueMap< float > > sigmatmtdToken_
edm::EDGetTokenT< edm::ValueMap< float > > sigmat0Token_
edm::EDGetTokenT< edm::ValueMap< float > > t0Token_
edm::EDGetTokenT< reco::TrackCollection > tracksToken_
edm::EDGetTokenT< edm::ValueMap< int > > trackAssocToken_
edm::EDGetTokenT< edm::ValueMap< float > > tmtdToken_
edm::EDGetTokenT< edm::ValueMap< float > > probKToken_
edm::EDGetTokenT< edm::ValueMap< float > > pathToken_
edm::EDGetTokenT< edm::ValueMap< float > > probPToken_
edm::EDGetTokenT< edm::ValueMap< float > > betaToken_

Member Function Documentation

◆ fillDescriptions()

void MTDSoAProducer::fillDescriptions ( edm::ConfigurationDescriptions descriptions)
static

Definition at line 61 of file MTDSoAProducer.cc.

References edm::ConfigurationDescriptions::add(), submitPVResolutionJobs::desc, and ProducerED_cfi::InputTag.

61  {
63  desc.add<edm::InputTag>("tracksSrc", edm::InputTag("generalTracks"));
64  desc.add<edm::InputTag>("trackAssocSrc", edm::InputTag("trackExtenderWithMTD:generalTrackassoc"));
65  desc.add<edm::InputTag>("t0Src", edm::InputTag("tofPID:t0"));
66  desc.add<edm::InputTag>("sigmat0Src", edm::InputTag("tofPID:sigmat0"));
67  desc.add<edm::InputTag>("tmtdSrc", edm::InputTag("trackExtenderWithMTD:generalTracktmtd"));
68  desc.add<edm::InputTag>("sigmatmtdSrc", edm::InputTag("trackExtenderWithMTD:generalTracksigmatmtd"));
69  desc.add<edm::InputTag>("betamtd", edm::InputTag("trackExtenderWithMTD:generalTrackBeta"));
70  desc.add<edm::InputTag>("pathmtd", edm::InputTag("trackExtenderWithMTD:generalTrackPathLength"));
71  desc.add<edm::InputTag>("mvaquality", edm::InputTag("mtdTrackQualityMVA:mtdQualMVA"));
72  desc.add<edm::InputTag>("posmtd", edm::InputTag("trackExtenderWithMTD:generalTrackmtdpos"));
73  desc.add<edm::InputTag>("momentum", edm::InputTag("trackExtenderWithMTD:generalTrackp"));
74  desc.add<edm::InputTag>("probPi", edm::InputTag("tofPID:probPi"));
75  desc.add<edm::InputTag>("probK", edm::InputTag("tofPID:probK"));
76  desc.add<edm::InputTag>("probP", edm::InputTag("tofPID:probP"));
77 
78  descriptions.add("mtdSoAProducer", desc);
79 }
void add(std::string const &label, ParameterSetDescription const &psetDescription)

◆ produce()

void MTDSoAProducer::produce ( edm::Event ev,
const edm::EventSetup es 
)
final

Definition at line 81 of file MTDSoAProducer.cc.

References HLT_2024v13_cff::beta, betaToken_, makeMEIFBenchmarkPlots::ev, cms::alpakatools::host(), momentumWithMTDToken_, eostools::move(), MVAQualityToken_, castor_dqm_sourceclient_file_cfg::path, pathToken_, posInMtdToken_, probKToken_, probPiToken_, probPToken_, sigmat0Token_, sigmatmtdToken_, FrontierCondition_GT_autoExpress_cfi::t0, t0Token_, tmtdToken_, trackAssocToken_, DiMuonV_cfg::tracks, and tracksToken_.

81  {
83  ev.getByToken(tracksToken_, tracksH);
84  const auto& tracks = *tracksH;
85 
86  const auto& trackAssoc = ev.get(trackAssocToken_);
87 
88  const auto& t0 = ev.get(t0Token_);
89  const auto& sigmat0 = ev.get(sigmat0Token_);
90 
91  const auto& tmtd = ev.get(tmtdToken_);
92  const auto& sigmatmtd = ev.get(sigmatmtdToken_);
93 
94  const auto& beta = ev.get(betaToken_);
95  const auto& path = ev.get(pathToken_);
96  const auto& MVAquality = ev.get(MVAQualityToken_);
97  const auto& posInMTD = ev.get(posInMtdToken_);
98  const auto& momentum = ev.get(momentumWithMTDToken_);
99  const auto& probPi = ev.get(probPiToken_);
100  const auto& probK = ev.get(probKToken_);
101  const auto& probP = ev.get(probPToken_);
102 
103  auto MtdInfo = std::make_unique<MtdHostCollection>(tracks.size(), cms::alpakatools::host());
104 
105  auto& MtdInfoView = MtdInfo->view();
106  for (unsigned int iTrack = 0; iTrack < tracks.size(); ++iTrack) {
107  const reco::TrackRef trackref(tracksH, iTrack);
108 
109  if (trackAssoc[trackref] == -1) {
110  MtdInfoView.trackAsocMTD()[iTrack] = -1;
111  MtdInfoView.time0()[iTrack] = 0.f;
112  MtdInfoView.time0Err()[iTrack] = -1.f;
113  MtdInfoView.time()[iTrack] = 0.f;
114  MtdInfoView.timeErr()[iTrack] = -1.f;
115  MtdInfoView.MVAquality()[iTrack] = 0.f;
116  MtdInfoView.pathLength()[iTrack] = 0.f;
117  MtdInfoView.beta()[iTrack] = 0.f;
118  MtdInfoView.posInMTD_x()[iTrack] = 0.f;
119  MtdInfoView.posInMTD_y()[iTrack] = 0.f;
120  MtdInfoView.posInMTD_z()[iTrack] = 0.f;
121  MtdInfoView.momentumWithMTD()[iTrack] = 0.f;
122  MtdInfoView.probPi()[iTrack] = 0.f;
123  MtdInfoView.probK()[iTrack] = 0.f;
124  MtdInfoView.probP()[iTrack] = 0.f;
125  continue;
126  }
127 
128  MtdInfoView.trackAsocMTD()[iTrack] = trackAssoc[trackref];
129  MtdInfoView.time0()[iTrack] = t0[trackref];
130  MtdInfoView.time0Err()[iTrack] = sigmat0[trackref];
131  MtdInfoView.time()[iTrack] = tmtd[trackref];
132  MtdInfoView.timeErr()[iTrack] = sigmatmtd[trackref];
133  MtdInfoView.MVAquality()[iTrack] = MVAquality[trackref];
134  MtdInfoView.pathLength()[iTrack] = path[trackref];
135  MtdInfoView.beta()[iTrack] = beta[trackref];
136  MtdInfoView.posInMTD_x()[iTrack] = posInMTD[trackref].x();
137  MtdInfoView.posInMTD_y()[iTrack] = posInMTD[trackref].y();
138  MtdInfoView.posInMTD_z()[iTrack] = posInMTD[trackref].z();
139  MtdInfoView.momentumWithMTD()[iTrack] = momentum[trackref];
140  MtdInfoView.probPi()[iTrack] = probPi[trackref];
141  MtdInfoView.probK()[iTrack] = probK[trackref];
142  MtdInfoView.probP()[iTrack] = probP[trackref];
143  }
144 
145  ev.put(std::move(MtdInfo));
146 }
edm::EDGetTokenT< edm::ValueMap< GlobalPoint > > posInMtdToken_
edm::EDGetTokenT< edm::ValueMap< float > > MVAQualityToken_
edm::EDGetTokenT< edm::ValueMap< float > > probPiToken_
edm::EDGetTokenT< edm::ValueMap< float > > momentumWithMTDToken_
edm::EDGetTokenT< edm::ValueMap< float > > sigmatmtdToken_
edm::EDGetTokenT< edm::ValueMap< float > > sigmat0Token_
edm::EDGetTokenT< edm::ValueMap< float > > t0Token_
edm::EDGetTokenT< reco::TrackCollection > tracksToken_
alpaka::DevCpu const & host()
Definition: host.h:14
edm::EDGetTokenT< edm::ValueMap< int > > trackAssocToken_
edm::EDGetTokenT< edm::ValueMap< float > > tmtdToken_
edm::EDGetTokenT< edm::ValueMap< float > > probKToken_
edm::EDGetTokenT< edm::ValueMap< float > > pathToken_
edm::EDGetTokenT< edm::ValueMap< float > > probPToken_
def move(src, dest)
Definition: eostools.py:511
edm::EDGetTokenT< edm::ValueMap< float > > betaToken_

Member Data Documentation

◆ betaToken_

edm::EDGetTokenT<edm::ValueMap<float> > MTDSoAProducer::betaToken_
private

Definition at line 32 of file MTDSoAProducer.cc.

Referenced by produce().

◆ momentumWithMTDToken_

edm::EDGetTokenT<edm::ValueMap<float> > MTDSoAProducer::momentumWithMTDToken_
private

Definition at line 36 of file MTDSoAProducer.cc.

Referenced by produce().

◆ MVAQualityToken_

edm::EDGetTokenT<edm::ValueMap<float> > MTDSoAProducer::MVAQualityToken_
private

Definition at line 34 of file MTDSoAProducer.cc.

Referenced by produce().

◆ pathToken_

edm::EDGetTokenT<edm::ValueMap<float> > MTDSoAProducer::pathToken_
private

Definition at line 33 of file MTDSoAProducer.cc.

Referenced by produce().

◆ posInMtdToken_

edm::EDGetTokenT<edm::ValueMap<GlobalPoint> > MTDSoAProducer::posInMtdToken_
private

Definition at line 35 of file MTDSoAProducer.cc.

Referenced by produce().

◆ probKToken_

edm::EDGetTokenT<edm::ValueMap<float> > MTDSoAProducer::probKToken_
private

Definition at line 38 of file MTDSoAProducer.cc.

Referenced by produce().

◆ probPiToken_

edm::EDGetTokenT<edm::ValueMap<float> > MTDSoAProducer::probPiToken_
private

Definition at line 37 of file MTDSoAProducer.cc.

Referenced by produce().

◆ probPToken_

edm::EDGetTokenT<edm::ValueMap<float> > MTDSoAProducer::probPToken_
private

Definition at line 39 of file MTDSoAProducer.cc.

Referenced by produce().

◆ sigmat0Token_

edm::EDGetTokenT<edm::ValueMap<float> > MTDSoAProducer::sigmat0Token_
private

Definition at line 29 of file MTDSoAProducer.cc.

Referenced by produce().

◆ sigmatmtdToken_

edm::EDGetTokenT<edm::ValueMap<float> > MTDSoAProducer::sigmatmtdToken_
private

Definition at line 31 of file MTDSoAProducer.cc.

Referenced by produce().

◆ t0Token_

edm::EDGetTokenT<edm::ValueMap<float> > MTDSoAProducer::t0Token_
private

Definition at line 28 of file MTDSoAProducer.cc.

Referenced by produce().

◆ tmtdToken_

edm::EDGetTokenT<edm::ValueMap<float> > MTDSoAProducer::tmtdToken_
private

Definition at line 30 of file MTDSoAProducer.cc.

Referenced by produce().

◆ trackAssocToken_

edm::EDGetTokenT<edm::ValueMap<int> > MTDSoAProducer::trackAssocToken_
private

Definition at line 27 of file MTDSoAProducer.cc.

Referenced by produce().

◆ tracksToken_

edm::EDGetTokenT<reco::TrackCollection> MTDSoAProducer::tracksToken_
private

Definition at line 26 of file MTDSoAProducer.cc.

Referenced by produce().