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