@@ -35,7 +35,8 @@ class VersionedIdProducer : public edm::stream::EDProducer<> {
3535 bool verbose_;
3636 TokenType physicsObjectSrc_;
3737
38- std::vector<std::unique_ptr<SelectorType> > ids_;
38+ std::vector<std::unique_ptr<SelectorType> > ids_;
39+
3940};
4041
4142//
@@ -52,6 +53,8 @@ class VersionedIdProducer : public edm::stream::EDProducer<> {
5253template < class PhysicsObjectPtr , class SelectorType >
5354VersionedIdProducer<PhysicsObjectPtr,SelectorType>::
5455VersionedIdProducer (const edm::ParameterSet& iConfig) {
56+ constexpr char bitmap_label[] = " _bitmap" ;
57+
5558 verbose_ = iConfig.getUntrackedParameter <bool >(" verbose" , false );
5659
5760 physicsObjectSrc_ =
@@ -102,16 +105,21 @@ VersionedIdProducer(const edm::ParameterSet& iConfig) {
102105 edm::LogWarning (" IdInformation" )
103106 << idmsg.str ();
104107
108+
109+
105110 produces<std::string>(idname);
106111 produces<edm::ValueMap<bool > >(idname);
107112 produces<edm::ValueMap<float > >(idname); // for PAT
108- produces<edm::ValueMap<unsigned > >(idname);
113+ produces<edm::ValueMap<unsigned > >(idname);
114+ produces<edm::ValueMap<unsigned > >(idname+std::string (bitmap_label));
109115 }
110116}
111117
112118template < class PhysicsObjectPtr , class SelectorType >
113119void VersionedIdProducer<PhysicsObjectPtr,SelectorType>::
114120produce (edm::Event& iEvent, const edm::EventSetup& iSetup) {
121+ constexpr char bitmap_label[] = " _bitmap" ;
122+
115123 edm::Handle<Collection> physicsObjectsHandle;
116124 iEvent.getByToken (physicsObjectSrc_,physicsObjectsHandle);
117125
@@ -121,14 +129,17 @@ produce(edm::Event& iEvent, const edm::EventSetup& iSetup) {
121129 std::auto_ptr<edm::ValueMap<bool > > outPass (new edm::ValueMap<bool >() );
122130 std::auto_ptr<edm::ValueMap<float > > outPassf (new edm::ValueMap<float >() );
123131 std::auto_ptr<edm::ValueMap<unsigned > > outHowFar (new edm::ValueMap<unsigned >() );
132+ std::auto_ptr<edm::ValueMap<unsigned > > outBitmap (new edm::ValueMap<unsigned >() );
124133 std::vector<bool > passfail;
125134 std::vector<float > passfailf;
126135 std::vector<unsigned > howfar;
136+ std::vector<unsigned > bitmap;
127137 for (size_t i = 0 ; i < physicsobjects.size (); ++i) {
128138 auto po = physicsobjects.ptrAt (i);
129139 passfail.push_back ((*id)(po,iEvent));
130140 passfailf.push_back (passfail.back ());
131141 howfar.push_back (id->howFarInCutFlow ());
142+ bitmap.push_back (id->bitMap ());
132143 }
133144
134145 edm::ValueMap<bool >::Filler fillerpassfail (*outPass);
@@ -143,11 +154,17 @@ produce(edm::Event& iEvent, const edm::EventSetup& iSetup) {
143154 fillerhowfar.insert (physicsObjectsHandle, howfar.begin (), howfar.end () );
144155 fillerhowfar.fill ();
145156
157+ edm::ValueMap<unsigned >::Filler fillerbitmap (*outBitmap);
158+ fillerbitmap.insert (physicsObjectsHandle, bitmap.begin (), bitmap.end () );
159+ fillerbitmap.fill ();
160+
146161 iEvent.put (outPass,id->name ());
147162 iEvent.put (outPassf,id->name ());
148163 iEvent.put (outHowFar,id->name ());
164+ iEvent.put (outBitmap,id->name ()+std::string (bitmap_label));
149165 iEvent.put (std::auto_ptr<std::string>(new std::string (id->md5String ())),
150166 id->name ());
167+
151168 }
152169}
153170
0 commit comments