CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
TriggerSummaryProducerRAW.cc
Go to the documentation of this file.
1 
13 
23 
24 #include <memory>
25 #include<vector>
26 
27 //
28 // constructors and destructor
29 //
31  pn_(ps.getParameter<std::string>("processName"))
32 {
33  if (pn_=="@") {
34 
36  if (tns.isAvailable()) {
37  pn_ = tns->getProcessName();
38  } else {
39  edm::LogError("TriggerSummaryProducerRaw") << "HLT Error: TriggerNamesService not available!";
40  pn_="*";
41  }
42  }
43 
44  LogDebug("TriggerSummaryProducerRaw") << "Using process name: '" << pn_ <<"'";
45  produces<trigger::TriggerEventWithRefs>();
46 
47  // Tell the getter what type of products to get and
48  // also the process to get them from
50  callWhenNewProductsRegistered(getterOfProducts_);
51 }
52 
54 {
55 }
56 
57 //
58 // member functions
59 //
60 
61 // ------------ method called to produce the data ------------
62 void
64 {
65  using namespace std;
66  using namespace edm;
67  using namespace reco;
68  using namespace trigger;
69 
70  std::vector<edm::Handle<trigger::TriggerFilterObjectWithRefs> > fobs;
71  getterOfProducts_.fillHandles(iEvent, fobs);
72 
73  const unsigned int nfob(fobs.size());
74  LogDebug("TriggerSummaryProducerRaw") << "Number of filter objects found: " << nfob;
75 
76  // construct single RAW product
77  auto_ptr<TriggerEventWithRefs> product(new TriggerEventWithRefs(pn_,nfob));
78  for (unsigned int ifob=0; ifob!=nfob; ++ifob) {
79  const string& label (fobs[ifob].provenance()->moduleLabel());
80  const string& instance (fobs[ifob].provenance()->productInstanceName());
81  const string& process (fobs[ifob].provenance()->processName());
82  const InputTag tag(label,instance,process);
83  LogTrace("TriggerSummaryProducerRaw")
84  << ifob << " " << tag << endl
85  << " Sizes: "
86  << " 1/" << fobs[ifob]->photonSize()
87  << " 2/" << fobs[ifob]->electronSize()
88  << " 3/" << fobs[ifob]->muonSize()
89  << " 4/" << fobs[ifob]->jetSize()
90  << " 5/" << fobs[ifob]->compositeSize()
91  << " 6/" << fobs[ifob]->basemetSize()
92  << " 7/" << fobs[ifob]->calometSize()
93 
94  << " 8/" << fobs[ifob]->pixtrackSize()
95  << " 9/" << fobs[ifob]->l1emSize()
96  << " A/" << fobs[ifob]->l1muonSize()
97  << " B/" << fobs[ifob]->l1jetSize()
98  << " C/" << fobs[ifob]->l1etmissSize()
99  << " D/" << fobs[ifob]->l1hfringsSize()
100  << " E/" << fobs[ifob]->pfjetSize()
101  << " F/" << fobs[ifob]->pftauSize()
102  << endl;
103  product->addFilterObject(tag,*fobs[ifob]);
104  }
105 
106  // place product in Event
107  OrphanHandle<TriggerEventWithRefs> ref = iEvent.put(product);
108  LogTrace("TriggerSummaryProducerRaw") << "Number of filter objects packed: " << ref->size();
109 
110  return;
111 }
#define LogDebug(id)
void callWhenNewProductsRegistered(std::function< void(BranchDescription const &)> const &func)
Definition: ProducerBase.h:44
std::string const & getProcessName() const
static PFTauRenderPlugin instance
edm::GetterOfProducts< trigger::TriggerFilterObjectWithRefs > getterOfProducts_
TriggerSummaryProducerRAW(const edm::ParameterSet &)
int iEvent
Definition: GenABIO.cc:243
OrphanHandle< PROD > put(std::auto_ptr< PROD > product)
Put a new product.
Definition: Event.h:94
bool isAvailable() const
Definition: Service.h:47
#define LogTrace(id)
std::string pn_
process name
virtual void produce(edm::Event &, const edm::EventSetup &)
void fillHandles(edm::Event const &event, std::vector< edm::Handle< T > > &handles) const
tuple process
Definition: LaserDQM_cfg.py:3