CMS 3D CMS Logo

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

Public Member Functions

template<class H , class T >
void fillValueMap (edm::Event &iEvent, const edm::Handle< H > &handle, const std::vector< T > &vec, const std::string &name) const
 
 MTDTrackQualityMVAProducer (const ParameterSet &pset)
 
void produce (edm::Event &ev, const edm::EventSetup &es) final
 
- Public Member Functions inherited from edm::stream::EDProducer<>
 EDProducer ()=default
 
bool hasAbilityToProduceInBeginLumis () const final
 
bool hasAbilityToProduceInBeginProcessBlocks () const final
 
bool hasAbilityToProduceInBeginRuns () const final
 
bool hasAbilityToProduceInEndLumis () const final
 
bool hasAbilityToProduceInEndProcessBlocks () const final
 
bool hasAbilityToProduceInEndRuns () const final
 

Static Public Member Functions

static void fillDescriptions (edm::ConfigurationDescriptions &descriptions)
 

Private Attributes

edm::EDGetTokenT< edm::ValueMap< float > > btlMatchChi2Token_
 
edm::EDGetTokenT< edm::ValueMap< float > > btlMatchTimeChi2Token_
 
edm::EDGetTokenT< edm::ValueMap< float > > etlMatchChi2Token_
 
edm::EDGetTokenT< edm::ValueMap< float > > etlMatchTimeChi2Token_
 
edm::EDGetTokenT< edm::ValueMap< float > > mtdTimeToken_
 
MTDTrackQualityMVA mva_
 
edm::EDGetTokenT< edm::ValueMap< float > > pathLengthToken_
 
edm::EDGetTokenT< edm::ValueMap< int > > trackAssocToken_
 
edm::EDGetTokenT< reco::TrackCollectiontracksMTDToken_
 
edm::EDGetTokenT< reco::TrackCollectiontracksToken_
 

Static Private Attributes

static constexpr char mvaName [] = "mtdQualMVA"
 

Additional Inherited Members

- Public Types inherited from edm::stream::EDProducer<>
typedef CacheContexts< T... > CacheTypes
 
typedef CacheTypes::GlobalCache GlobalCache
 
typedef AbilityChecker< T... > HasAbility
 
typedef CacheTypes::LuminosityBlockCache LuminosityBlockCache
 
typedef LuminosityBlockContextT< LuminosityBlockCache, RunCache, GlobalCacheLuminosityBlockContext
 
typedef CacheTypes::LuminosityBlockSummaryCache LuminosityBlockSummaryCache
 
typedef CacheTypes::RunCache RunCache
 
typedef RunContextT< RunCache, GlobalCacheRunContext
 
typedef CacheTypes::RunSummaryCache RunSummaryCache
 

Detailed Description

Definition at line 21 of file MTDTrackQualityMVAProducer.cc.

Constructor & Destructor Documentation

◆ MTDTrackQualityMVAProducer()

MTDTrackQualityMVAProducer::MTDTrackQualityMVAProducer ( const ParameterSet pset)

Definition at line 52 of file MTDTrackQualityMVAProducer.cc.

53  : tracksToken_(consumes<reco::TrackCollection>(iConfig.getParameter<edm::InputTag>("tracksSrc"))),
54  tracksMTDToken_(consumes<reco::TrackCollection>(iConfig.getParameter<edm::InputTag>("tracksMTDSrc"))),
55  btlMatchChi2Token_(consumes<edm::ValueMap<float>>(iConfig.getParameter<edm::InputTag>("btlMatchChi2Src"))),
57  consumes<edm::ValueMap<float>>(iConfig.getParameter<edm::InputTag>("btlMatchTimeChi2Src"))),
58  etlMatchChi2Token_(consumes<edm::ValueMap<float>>(iConfig.getParameter<edm::InputTag>("etlMatchChi2Src"))),
60  consumes<edm::ValueMap<float>>(iConfig.getParameter<edm::InputTag>("etlMatchTimeChi2Src"))),
61  mtdTimeToken_(consumes<edm::ValueMap<float>>(iConfig.getParameter<edm::InputTag>("mtdTimeSrc"))),
62  pathLengthToken_(consumes<edm::ValueMap<float>>(iConfig.getParameter<edm::InputTag>("pathLengthSrc"))),
63  trackAssocToken_(consumes<edm::ValueMap<int>>(iConfig.getParameter<edm::InputTag>("trackAssocSrc"))),
64  mva_(iConfig.getParameter<edm::FileInPath>("qualityBDT_weights_file").fullPath()) {
65  produces<edm::ValueMap<float>>(mvaName);
66 }

References mvaName.

Member Function Documentation

◆ fillDescriptions()

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

Definition at line 69 of file MTDTrackQualityMVAProducer.cc.

69  {
71  desc.add<edm::InputTag>("tracksSrc", edm::InputTag("generalTracks"))->setComment("Input tracks collection");
72  desc.add<edm::InputTag>("tracksMTDSrc", edm::InputTag("trackExtenderWithMTD"))
73  ->setComment("Input tracks collection for MTD extended tracks");
74  desc.add<edm::InputTag>("btlMatchChi2Src", edm::InputTag("trackExtenderWithMTD", "btlMatchChi2"))
75  ->setComment("BTL Chi2 Matching value Map");
76  desc.add<edm::InputTag>("btlMatchTimeChi2Src", edm::InputTag("trackExtenderWithMTD", "btlMatchTimeChi2"))
77  ->setComment("BTL Chi2 Matching value Map");
78  desc.add<edm::InputTag>("etlMatchChi2Src", edm::InputTag("trackExtenderWithMTD", "etlMatchChi2"))
79  ->setComment("ETL Chi2 Matching value Map");
80  desc.add<edm::InputTag>("etlMatchTimeChi2Src", edm::InputTag("trackExtenderWithMTD", "etlMatchTimeChi2"))
81  ->setComment("ETL Chi2 Matching value Map");
82  desc.add<edm::InputTag>("mtdTimeSrc", edm::InputTag("trackExtenderWithMTD", "tmtd"))
83  ->setComment("MTD TIme value Map");
84  desc.add<edm::InputTag>("pathLengthSrc", edm::InputTag("trackExtenderWithMTD", "pathLength"))
85  ->setComment("MTD PathLength value Map");
86  desc.add<edm::InputTag>("trackAssocSrc", edm::InputTag("trackExtenderWithMTD", "generalTrackassoc"))
87  ->setComment("Association between General and MTD Extended tracks");
88  desc.add<edm::FileInPath>("qualityBDT_weights_file",
89  edm::FileInPath("RecoMTD/TimingIDTools/data/clf4D_MTDquality_bo.xml"))
90  ->setComment("Track MTD quality BDT weights");
91  descriptions.add("mtdTrackQualityMVAProducer", desc);
92 }

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

◆ fillValueMap()

template<class H , class T >
void MTDTrackQualityMVAProducer::fillValueMap ( edm::Event iEvent,
const edm::Handle< H > &  handle,
const std::vector< T > &  vec,
const std::string &  name 
) const

Definition at line 95 of file MTDTrackQualityMVAProducer.cc.

98  {
99  auto out = std::make_unique<edm::ValueMap<T>>();
101  filler.insert(handle, vec.begin(), vec.end());
102  filler.fill();
103  iEvent.put(std::move(out), name);
104 }

References trigObjTnPSource_cfi::filler, patZpeak::handle, iEvent, eostools::move(), Skims_PA_cff::name, and MillePedeFileConverter_cfg::out.

Referenced by produce().

◆ produce()

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

Definition at line 106 of file MTDTrackQualityMVAProducer.cc.

106  {
108  ev.getByToken(tracksToken_, tracksH);
109  const auto& tracks = *tracksH;
110 
112  ev.getByToken(tracksMTDToken_, tracksMTDH);
113 
114  const auto& btlMatchChi2 = ev.get(btlMatchChi2Token_);
115  const auto& btlMatchTimeChi2 = ev.get(btlMatchTimeChi2Token_);
116  const auto& etlMatchChi2 = ev.get(etlMatchChi2Token_);
117  const auto& etlMatchTimeChi2 = ev.get(etlMatchTimeChi2Token_);
118  const auto& pathLength = ev.get(pathLengthToken_);
119  const auto& trackAssoc = ev.get(trackAssocToken_);
120  const auto& mtdTime = ev.get(mtdTimeToken_);
121 
122  std::vector<float> mvaOutRaw;
123 
124  //Loop over tracks collection
125  for (unsigned int itrack = 0; itrack < tracks.size(); ++itrack) {
126  const reco::TrackRef trackref(tracksH, itrack);
127  if (trackAssoc[trackref] == -1)
128  mvaOutRaw.push_back(-1.);
129  else {
130  const reco::TrackRef mtdTrackref = reco::TrackRef(tracksMTDH, trackAssoc[trackref]);
131  mvaOutRaw.push_back(mva_(
132  trackref, mtdTrackref, btlMatchChi2, btlMatchTimeChi2, etlMatchChi2, etlMatchTimeChi2, mtdTime, pathLength));
133  }
134  }
135  fillValueMap(ev, tracksH, mvaOutRaw, mvaName);
136 }

References btlMatchChi2Token_, btlMatchTimeChi2Token_, etlMatchChi2Token_, etlMatchTimeChi2Token_, ev, fillValueMap(), mtdTimeToken_, mva_, mvaName, pathLengthToken_, trackAssocToken_, tracks, tracksMTDToken_, and tracksToken_.

Member Data Documentation

◆ btlMatchChi2Token_

edm::EDGetTokenT<edm::ValueMap<float> > MTDTrackQualityMVAProducer::btlMatchChi2Token_
private

Definition at line 41 of file MTDTrackQualityMVAProducer.cc.

Referenced by produce().

◆ btlMatchTimeChi2Token_

edm::EDGetTokenT<edm::ValueMap<float> > MTDTrackQualityMVAProducer::btlMatchTimeChi2Token_
private

Definition at line 42 of file MTDTrackQualityMVAProducer.cc.

Referenced by produce().

◆ etlMatchChi2Token_

edm::EDGetTokenT<edm::ValueMap<float> > MTDTrackQualityMVAProducer::etlMatchChi2Token_
private

Definition at line 43 of file MTDTrackQualityMVAProducer.cc.

Referenced by produce().

◆ etlMatchTimeChi2Token_

edm::EDGetTokenT<edm::ValueMap<float> > MTDTrackQualityMVAProducer::etlMatchTimeChi2Token_
private

Definition at line 44 of file MTDTrackQualityMVAProducer.cc.

Referenced by produce().

◆ mtdTimeToken_

edm::EDGetTokenT<edm::ValueMap<float> > MTDTrackQualityMVAProducer::mtdTimeToken_
private

Definition at line 45 of file MTDTrackQualityMVAProducer.cc.

Referenced by produce().

◆ mva_

MTDTrackQualityMVA MTDTrackQualityMVAProducer::mva_
private

Definition at line 49 of file MTDTrackQualityMVAProducer.cc.

Referenced by produce().

◆ mvaName

constexpr char MTDTrackQualityMVAProducer::mvaName[] = "mtdQualMVA"
staticconstexprprivate

Definition at line 36 of file MTDTrackQualityMVAProducer.cc.

Referenced by MTDTrackQualityMVAProducer(), and produce().

◆ pathLengthToken_

edm::EDGetTokenT<edm::ValueMap<float> > MTDTrackQualityMVAProducer::pathLengthToken_
private

Definition at line 46 of file MTDTrackQualityMVAProducer.cc.

Referenced by produce().

◆ trackAssocToken_

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

Definition at line 47 of file MTDTrackQualityMVAProducer.cc.

Referenced by produce().

◆ tracksMTDToken_

edm::EDGetTokenT<reco::TrackCollection> MTDTrackQualityMVAProducer::tracksMTDToken_
private

Definition at line 39 of file MTDTrackQualityMVAProducer.cc.

Referenced by produce().

◆ tracksToken_

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

Definition at line 38 of file MTDTrackQualityMVAProducer.cc.

Referenced by produce().

MTDTrackQualityMVAProducer::btlMatchTimeChi2Token_
edm::EDGetTokenT< edm::ValueMap< float > > btlMatchTimeChi2Token_
Definition: MTDTrackQualityMVAProducer.cc:42
MTDTrackQualityMVAProducer::tracksMTDToken_
edm::EDGetTokenT< reco::TrackCollection > tracksMTDToken_
Definition: MTDTrackQualityMVAProducer.cc:39
MTDTrackQualityMVAProducer::mva_
MTDTrackQualityMVA mva_
Definition: MTDTrackQualityMVAProducer.cc:49
patZpeak.handle
handle
Definition: patZpeak.py:23
MTDTrackQualityMVAProducer::btlMatchChi2Token_
edm::EDGetTokenT< edm::ValueMap< float > > btlMatchChi2Token_
Definition: MTDTrackQualityMVAProducer.cc:41
HLT_FULL_cff.InputTag
InputTag
Definition: HLT_FULL_cff.py:89285
edm::ParameterSetDescription
Definition: ParameterSetDescription.h:52
MTDTrackQualityMVAProducer::fillValueMap
void fillValueMap(edm::Event &iEvent, const edm::Handle< H > &handle, const std::vector< T > &vec, const std::string &name) const
Definition: MTDTrackQualityMVAProducer.cc:95
edm::Handle< reco::TrackCollection >
edm::Ref< TrackCollection >
MTDTrackQualityMVAProducer::pathLengthToken_
edm::EDGetTokenT< edm::ValueMap< float > > pathLengthToken_
Definition: MTDTrackQualityMVAProducer.cc:46
MTDTrackQualityMVAProducer::mvaName
static constexpr char mvaName[]
Definition: MTDTrackQualityMVAProducer.cc:36
MTDTrackQualityMVAProducer::etlMatchTimeChi2Token_
edm::EDGetTokenT< edm::ValueMap< float > > etlMatchTimeChi2Token_
Definition: MTDTrackQualityMVAProducer.cc:44
edm::FileInPath
Definition: FileInPath.h:64
edm::ConfigurationDescriptions::add
void add(std::string const &label, ParameterSetDescription const &psetDescription)
Definition: ConfigurationDescriptions.cc:57
MTDTrackQualityMVAProducer::mtdTimeToken_
edm::EDGetTokenT< edm::ValueMap< float > > mtdTimeToken_
Definition: MTDTrackQualityMVAProducer.cc:45
MTDTrackQualityMVAProducer::etlMatchChi2Token_
edm::EDGetTokenT< edm::ValueMap< float > > etlMatchChi2Token_
Definition: MTDTrackQualityMVAProducer.cc:43
reco::TrackRef
edm::Ref< TrackCollection > TrackRef
persistent reference to a Track
Definition: TrackFwd.h:20
tracks
const uint32_t *__restrict__ const HitContainer *__restrict__ TkSoA *__restrict__ tracks
Definition: CAHitNtupletGeneratorKernelsImpl.h:159
trigObjTnPSource_cfi.filler
filler
Definition: trigObjTnPSource_cfi.py:21
iEvent
int iEvent
Definition: GenABIO.cc:224
MTDTrackQualityMVAProducer::trackAssocToken_
edm::EDGetTokenT< edm::ValueMap< int > > trackAssocToken_
Definition: MTDTrackQualityMVAProducer.cc:47
submitPVResolutionJobs.desc
string desc
Definition: submitPVResolutionJobs.py:251
eostools.move
def move(src, dest)
Definition: eostools.py:511
edm::ValueMap< float >
ev
bool ev
Definition: Hydjet2Hadronizer.cc:95
Skims_PA_cff.name
name
Definition: Skims_PA_cff.py:17
MillePedeFileConverter_cfg.out
out
Definition: MillePedeFileConverter_cfg.py:31
edm::helper::Filler
Definition: ValueMap.h:22
edm::InputTag
Definition: InputTag.h:15
MTDTrackQualityMVAProducer::tracksToken_
edm::EDGetTokenT< reco::TrackCollection > tracksToken_
Definition: MTDTrackQualityMVAProducer.cc:38
edm::FileInPath::fullPath
std::string fullPath() const
Definition: FileInPath.cc:161