ShowerProducedPtrsHolder.hh
Go to the documentation of this file.
1 //###################################################################
2 //### Name: ShowerProducedPtrsHolder ###
3 //### Author: Dominic Barker ###
4 //### Date: 15.07.19 ###
5 //### Description: Class to holder the unique ptrs required to ###
6 //### produce data products. Used in ###
7 //### LArPandoraModularShower and corresponding ###
8 //### tools. ###
9 //###################################################################
10 
11 #ifndef ShowerProducedPtrsHolder_HH
12 #define ShowerProducedPtrsHolder_HH
13 
14 //Framework includes
17 
18 namespace reco::shower {
19  class ShowerUniqueProduerPtrBase;
20  template <class T> class ShowerUniqueProductPtr;
21  template <class T> class ShowerUniqueAssnPtr;
22  class ShowerPtrMakerBase;
23  template <class T> class ShowerPtrMaker;
25 }
26 
27 //Template to check if its an assn
28 template <class N>
29 struct is_assn { static const int value = 0; };
30 
31 template <class L, class R, class D>
32 struct is_assn<art::Assns< L, R, D > >{ static const int value = 1; };
33 
34 //Template to carry the type becuase functions can't, annoyingly, be partially specialised
35 template <typename T>
36 struct type{};
37 
38 
39 //Base class for the class that holds the ptr.
41 
42  public:
43 
44  virtual ~ShowerUniqueProduerPtrBase() noexcept = default;
45 
46  virtual void reset() = 0;
47 
48  virtual void AddDataProduct(const reco::shower::ShowerElementHolder& selement_holder, const std::string& Name) = 0;
49 
50  virtual void MoveToEvent(art::Event& evt) = 0;
51 
52  virtual std::string GetType() const = 0;
53  virtual std::string GetInstanceName() const = 0;
54 
55  virtual int GetVectorPtrSize() const {return -1;}
56 };
57 
58 //Class that holds a unique ptr for the product. This is what is stored in the map. The product is put into
59 //the event as a vector so the this holder maintains this unique ptr and the actions to manipulate it.
60 template <class T>
62 
63  public:
64 
66  ptr = 1;
67  showeruniqueptr = std::make_unique<std::vector<T> >();
68  InstanceName = Instancename;
69  }
70 
71  //Get the unique ptr for the data product.
72  std::unique_ptr<T>& GetPtr() {
73  if(ptr){
74  return showeruniqueptr;
75  }
76  else{
77  throw cet::exception("ShowerUniqueProduerPtr") << "Element does not exist" << std::endl;
78  }
79  }
80 
81  void reset() override {
82  showeruniqueptr.reset(new std::vector<T>());
83  }
84 
85  //Add a data product on to the vector that will be added to the event.
86  void AddDataProduct(const reco::shower::ShowerElementHolder& selement_holder, const std::string& Name) override {
87  T product;
88  if (!selement_holder.CheckElement(Name)){
89  mf::LogError("ShowerProducedPtrsHolder") << "Trying to add data product: " << Name << ". This element does not exist in the element holder" << std::endl;
90  return;
91  }
92 
93  int err = selement_holder.GetElement(Name, product);
94  if(err){
95  mf::LogError("ShowerProducedPtrsHolder") << "Trying to add data product: " << Name << ". This element does not exist in the element holder" << std::endl;
96  return;
97  }
98  showeruniqueptr->push_back(product);
99  return;
100  }
101 
102  //Final thing to do move to the event.
103  void MoveToEvent(art::Event& evt) override {
104  evt.put(std::move(showeruniqueptr),InstanceName);
105  }
106 
107  //This returns the type of the undrlying element. It should be of the form std::unique_ptr<std::vector<T> >
108  std::string GetType() const override {
109  return cet::demangle_symbol(typeid(showeruniqueptr.get()).name());
110  }
111 
112  //A user can set the instances name like an other producer module product. Get it using this.
113  std::string GetInstanceName() const override {
114  return InstanceName;
115  }
116 
117  //Get the size of the std::vector. Usful for making assns.
118  int GetVectorPtrSize() const override {
119  return showeruniqueptr->size();
120  }
121 
122 
123  private:
124 
125  //Element itself that is put into the art event.
126  std::unique_ptr<std::vector<T> > showeruniqueptr;
127 
128  //bool to see if the element is set.
129  bool ptr;
130 
131  //Name when saved into the the event default is ""
133 };
134 
135 
136 //Class that holds a unique ptr for the association. This is what is stored in the map. The association is put into
137 //the event as a vector so the this holder maintains this unique ptr and the actions to manipulate it.
138 //I guess if the product if a product is unique to the event then this holder will deal with it.
139 //I have tried to be smart and I don't think it not being an association is a problem as
140 //long as the user is smart.
141 template <class T>
143 
144  public:
145 
146  ShowerUniqueAssnPtr(const std::string& Instancename){
147  ptr = 1;
148  showeruniqueptr = std::make_unique<T>();
149  InstanceName = Instancename;
150  }
151 
152  //Get the ptr to the association.
153  std::unique_ptr<T>& GetPtr() {
154  if(ptr){
155  return showeruniqueptr;
156  }
157  else{
158  throw cet::exception("ShowerUniqueAssnPtr") << "Element does not exist" << std::endl;
159  }
160  }
161 
162  void reset() override {
163  showeruniqueptr.reset(new T());
164  }
165 
166  //place the association to the event.
167  void MoveToEvent(art::Event& evt) override {
168  evt.put(std::move(showeruniqueptr), InstanceName);
169  }
170 
171  //Not need but the compiler complains if its not here.
172  void AddDataProduct(const reco::shower::ShowerElementHolder& selement_holder, const std::string& Name) override {
173  throw cet::exception("ShowerUniqueAssnPtr") << "The creator of this code has failed you. Please contact Dominic Bakrer" << std::endl;
174  }
175 
176  //Get the type in form as a string. It should be the form of std::unique_ptr<art::Assn<T A, T1 B> >
177  std::string GetType() const override {
178  return cet::demangle_symbol(typeid(showeruniqueptr.get()).name());
179  }
180 
181  //Get the Instance name that product will be saved as in the art::Event.
182  std::string GetInstanceName() const override {
183  return InstanceName;
184  }
185 
186 
187  private:
188 
189  //Actual Element the assn. This is put into the event.
190  std::unique_ptr<T> showeruniqueptr;
191 
192  //bool to see if the element is filled.
193  bool ptr;
194 
195  //Name when saved into the the event default is ""
197 };
198 
199 
200 //Base class to hold the pointer makers. This interacts the with the module a little differently
201 //as the ptr makers do not work within the tools. The holds and the ptrmaker and provides set and
202 //get functions so that the usr can access art::Ptrs for the products of the module and associate
203 //them to other things.
205 
206  public:
207 
208  virtual ~ShowerPtrMakerBase() noexcept = default;
209 
210  virtual bool CheckPtrMaker() const = 0;
211 
212  virtual void SetPtrMaker(art::Event& evt) = 0;
213 
214  virtual void Reset() = 0;
215 
216 };
217 
218 //Derived class - See above
219 template<class T>
221 
222  public:
223 
224 
225  ShowerPtrMaker(const std::string& Instancename){
226  ptrmaker = nullptr;
227  ptr = 0;
228  InstanceName = Instancename;
229  }
230 
231  //Check the ptr maker is ready to be used.
232  bool CheckPtrMaker() const override {
233  if(ptr){
234  return true;
235  }
236  return false;
237  }
238 
239  //Return the ptr maker. Probably never needed.
241  if(ptr){
242  if(ptrmaker == nullptr){
243  throw cet::exception("ShowerPtrMaker") << "Ptr maker ptr is null" << std::endl;
244  }
245  return *ptrmaker;
246  }
247  throw cet::exception("ShowerPtrMaker") << "Trying to get a ptrmaker that does not exists" << std::endl;
248  }
249 
250  //Return the art ptr that the module produces corresponding the index iter
251  art::Ptr<T> GetArtPtr(int iter) const {
252  if(ptr){
253  if(ptrmaker == nullptr){
254  throw cet::exception("ShowerPtrMaker") << "Ptr maker ptr is null" << std::endl;
255  }
256  return (*ptrmaker)(iter);
257  }
258  throw cet::exception("ShowerPtrMaker") << "Trying to get a ptrmaker that does not exists" << std::endl;
259  }
260 
261  //Set the ptr maker this is reset at the start of the event.
262  void SetPtrMaker(art::Event& evt) override {
263  ptrmaker.reset(new art::PtrMaker<T>(evt,InstanceName));
264  ptr = 1;
265  }
266 
267  void Reset() override {
268  if(!ptr){
269  throw cet::exception("ShowerPtrMaker") << "Trying to reset ptr but it has not been set in the first place. Please contatc Dom Barker" << std::endl;
270  }
271  ptrmaker.reset(nullptr);
272  ptr = 0;
273  }
274 
275  private:
276 
277  //The ptr maker itself. Used to make art::Ptrs to make assns.
278  std::unique_ptr<art::PtrMaker<T> > ptrmaker;
279 
280  //The name of the data product which will be saved in the event. The ptr maker requires this.
282 
283  //bool to tell if the ptr maker is ready to use or not.
284  int ptr;
285 };
286 
287 //Class that holds all the unique ptrs and the ptr makers. It is what the tools and module use
288 //to access the above class elements. The end user case will see the user not interact with this
289 // directly.
291 
292  public:
293 
294  //Initialise the a unique ptr in the map. This will be added to the event.
295  template <class T>
297 
298  //Add to the assns
299  if(showerassnPtrs.find(Name) != showerassnPtrs.end()){
300  mf::LogWarning("ShowerProducedPtrsHolder") << "Trying to set Element: " << Name << ". This element has already been set. Please check." << std::endl;
301  return 1;
302  }
303 
304  //Check the same type has not already been set.
305  if(!CheckForMultipleTypes(type<T>(), Name, Instance)){
306  throw cet::exception("ShowerProducedPtrsHolder") << "Trying to set multiple objects with same type with no instance name or same instance name" << std::endl;
307  }
308 
309  showerassnPtrs[Name] = std::make_unique<ShowerUniqueAssnPtr<T> >(Instance);
310  return 0;
311  }
312 
313  //Set the unique ptr. The unique ptr will be filled into the event.
314  template <class T>
315  int SetShowerUniqueProduerPtr(type<std::vector<T> >, const std::string& Name, const std::string& Instance=""){
316 
317  //Then add the products
318  if(showerproductPtrs.find(Name) != showerproductPtrs.end()){
319  mf::LogWarning("ShowerProducedPtrsHolder") << "Trying to set Element: " << Name << ". This element has already been set. Please check." << std::endl;
320  return 1;
321  }
322 
323  //Check the same type has not already been set.
324  if(!CheckForMultipleTypes(type<std::vector<T> >(), Name, Instance)){
325  throw cet::exception("ShowerProducedPtrsHolder") << "Trying to set multiple objects with same type with no instance name or same instance name" << std::endl;
326  }
327 
328  if(showerPtrMakers.find(Name) != showerPtrMakers.end()){
329  throw cet::exception("ShowerProducedPtrsHolder") << "PtrMaker already exist. It should not be set again" << std::endl;
330  }
331  showerPtrMakers[Name] = std::make_unique<ShowerPtrMaker<T> >(Instance);
332  showerproductPtrs[Name] = std::make_unique<ShowerUniqueProductPtr<std::vector<T > > >(Instance);
333  return 0;
334  }
335 
336 
337  //Checks if the ptr exists
339  if(showerproductPtrs.find(Name) != showerproductPtrs.end()){
340  return true;
341  }
342  if(showerassnPtrs.find(Name) != showerassnPtrs.end()){
343  return true;
344  }
345  return false;
346  }
347 
348  //Reset the ptrs;
349  void reset(){
350  for(auto const& showerptr: showerproductPtrs){
351  (showerptr.second)->reset();
352  }
353  for(auto const& showerptr: showerassnPtrs){
354  (showerptr.second)->reset();
355  }
356  }
357 
358  //Add any data products that are produced by the module to the unique ptr it corresponds to
359  //This is done by matching strings in the element holder and the ptr holder. Hence these
360  //must match. This is a global command done in the module.
362  for(auto const& showerproductPtr: showerproductPtrs){
363  (showerproductPtr.second)->AddDataProduct(selement_holder, showerproductPtr.first);
364  }
365  }
366 
367  //Global command to move all products into the event. This is done in the module.
369  for(auto const& showerproductPtr: showerproductPtrs){
370  (showerproductPtr.second)->MoveToEvent(evt);
371  }
372  for(auto const& showerassnPtr: showerassnPtrs){
373  (showerassnPtr.second)->MoveToEvent(evt);
374  }
375  }
376 
378  bool checked = true;
379  for(auto const& showerproductPtr: showerproductPtrs){
380  if(showerproductPtr.first == "shower"){continue;}
381  checked *= selement_holder.CheckElement(showerproductPtr.first);
382  }
383  return checked;
384  }
385 
386 
387  //This returns the unique ptr. This is a legacy code.
388  template <class T>
390  auto const showerproductPtrsIt = showerproductPtrs.find(Name);
391  if(showerproductPtrsIt != showerproductPtrs.end()){
392  reco::shower::ShowerUniqueProductPtr<T>* prod = dynamic_cast<reco::shower::ShowerUniqueProductPtr<T> *>(showerproductPtrsIt->second.get());
393  return prod->GetPtr();
394  }
395 
396  auto const showerassnPtrsIt = showerassnPtrs.find(Name);
397  if(showerassnPtrsIt != showerassnPtrs.end()){
398  reco::shower::ShowerUniqueAssnPtr<T>* assn = dynamic_cast<reco::shower::ShowerUniqueAssnPtr<T> *>(showerassnPtrsIt->second.get());
399  return assn->GetPtr();
400  }
401 
402  throw cet::exception("ShowerProducedPtrsHolder") << "Trying to get Ptr for: " << Name << " but Element does not exist" << std::endl;
403  }
404 
405  //Wrapper so that the use the addSingle command for the association. Add A and B to the association just
406  //as if add single add.
407  template <class T, class A, class B>
408  void AddSingle(A& a, B& b, const std::string& Name){
409  auto const showerassnPtrsIt = showerassnPtrs.find(Name);
410  if(showerassnPtrsIt == showerassnPtrs.end()){
411  throw cet::exception("ShowerProducedPtrsHolder") << "Trying to get the association: " << Name << "Element does not exist" << std::endl;
412  }
413  if(!is_assn<T>::value){
414  throw cet::exception("ShowerProducedPtrsHolder") << "Element type is not an assoication please only use this for assocations" << std::endl;
415  }
416  reco::shower::ShowerUniqueAssnPtr<T>* assnptr = dynamic_cast<reco::shower::ShowerUniqueAssnPtr<T> *>(showerassnPtrsIt->second.get());
417  if(assnptr == nullptr){
418  throw cet::exception("ShowerProducedPtrsHolder") << "Failed to cast back. Maybe you got the type wrong or you are accidently accessing a differently named product" << std::endl;
419  }
420 
421  T* assn = dynamic_cast<T*>(assnptr->GetPtr().get());
422  if(assn == nullptr){
423  throw cet::exception("ShowerProducedPtrsHolder") << "Something went wrong trying to cast tothe assn. Maybe the name: " << Name << " exists but its not an assn" << std::endl;
424  }
425 
426  assn->addSingle(a,b);
427  return;
428  }
429 
430  //Initialise the ptr makers. This is done at the the start of the module.
432  for(auto const& showerPtrMaker: showerPtrMakers){
433  if(showerPtrMakers.find(showerPtrMaker.first) == showerPtrMakers.end()){
434  throw cet::exception("ShowerProducedPtrsHolder") << "PtrMaker was empty. This is concerning" << std::endl;
435  }
436  showerPtrMakers[showerPtrMaker.first]->SetPtrMaker(evt);
437  }
438  }
439 
440  //Wrapper to access a particle PtrMaker. This is legacy as is not used.
441  template <class T>
443  auto const showerPtrMakersIt = showerPtrMakers.find(Name);
444  if(showerPtrMakersIt == showerPtrMakers.end()){
445  throw cet::exception("ShowerProducedPtrsHolder") << "PtrMaker does not exist" << std::endl;
446  }
447  else{
448  if(!showerPtrMakersIt->second->CheckPtrMaker()){
449  throw cet::exception("ShowerProducedPtrsHolder") << "PtrMaker is not set" << std::endl;
450  }
451  reco::shower::ShowerPtrMaker<T>* ptrmaker = dynamic_cast<reco::shower::ShowerPtrMaker<T> *>(showerassnPtrs[Name].get());
452  return ptrmaker->GetPtrMaker();
453  }
454  }
455 
456  //Wrapper to return to the the user the art ptr corresponding the index iter
457  template <class T>
458  art::Ptr<T> GetArtPtr(const std::string& Name, const int& iter) const {
459  auto const showerPtrMakersIt = showerPtrMakers.find(Name);
460  if(showerPtrMakersIt == showerPtrMakers.end()){
461  throw cet::exception("ShowerProducedPtrsHolder") << "PtrMaker does not exist for " << Name << " Did you initialise this? " << std::endl;
462  }
463  else{
464  if(!showerPtrMakersIt->second->CheckPtrMaker()){
465  throw cet::exception("ShowerProducedPtrsHolder") << "PtrMaker is not set. This is an issue for the devlopment team me. Contact Dom Barker" << std::endl;
466  }
467  reco::shower::ShowerPtrMaker<T>* ptrmaker = dynamic_cast<reco::shower::ShowerPtrMaker<T> *>(showerPtrMakersIt->second.get());
468  if(ptrmaker == nullptr){
469  throw cet::exception("ShowerProducedPtrsHolder") << "Failed to cast back. Maybe you got the type wrong or you are accidently accessing a differently named product" << std::endl;
470  }
471  return ptrmaker->GetArtPtr(iter);
472  }
473  }
474 
475  //Legacy not used.
477  for(auto const& showerPtrMaker: showerPtrMakers){
478  (showerPtrMaker.second)->Reset();
479  }
480  }
481 
482  //Return the size of the std::vector of the data object with the unique name string.
483  int GetVectorPtrSize(const std::string& Name) const {
484  auto const showerproductPtrsIt = showerproductPtrs.find(Name);
485  if(showerproductPtrsIt != showerproductPtrs.end()){
486  return showerproductPtrsIt->second->GetVectorPtrSize();
487  }
488  throw cet::exception("ShowerProducedPtrsHolder") << "Product: " << Name << " has not been set in the producers map" << std::endl;
489  }
490 
491  //Print the type, the element name and the instance name
492  void PrintPtr(const std::string& Name) const {
493  auto const showerproductPtrsIt = showerproductPtrs.find(Name);
494  if(showerproductPtrsIt != showerproductPtrs.end()){
495  const std::string Type = showerproductPtrsIt->second->GetType();
496  const std::string InstanceName = showerproductPtrsIt->second->GetInstanceName();
497  std::cout << "Element Name: " << Name << " Instance Name: " << InstanceName << " Type: " << Type << std::endl;
498  return;
499  }
500  auto const showerassnPtrsIt = showerassnPtrs.find(Name);
501  if(showerassnPtrsIt != showerassnPtrs.end()){
502  const std::string Type = showerassnPtrsIt->second->GetType();
503  const std::string InstanceName = showerassnPtrsIt->second->GetInstanceName();
504  std::cout << "Element Name: " << Name << " Instance Name: " << InstanceName << " Type: " << Type << std::endl;
505  return;
506  }
507  mf::LogError("ShowerProducedPtrsHolder") << "Trying to print Element: " << Name << ". This element does not exist in the element holder" << std::endl;
508  return;
509  }
510 
511 
512  //This function will print out all the pointers and there types for the user to check.
513  void PrintPtrs() const {
514 
515  unsigned int maxname = 0;
516  for(auto const& showerprodPtr: showerproductPtrs){
517  if(showerprodPtr.first.size() > maxname){
518  maxname = showerprodPtr.first.size();
519  }
520  }
521  for(auto const& showerassnPtr: showerassnPtrs){
522  if(showerassnPtr.first.size() > maxname){
523  maxname = showerassnPtr.first.size();
524  }
525  }
526 
527  std::map<std::string,std::pair<std::string,std::string> > Type_showerprodPtrs;
528  std::map<std::string,std::pair<std::string,std::string> > Type_showerassnPtrs;
529  for(auto const& showerprodPtr: showerproductPtrs){
530  const std::string Type = (showerprodPtr.second)->GetType();
531  const std::string InstanceName = (showerprodPtr.second)->GetInstanceName();
532  Type_showerprodPtrs[showerprodPtr.first] = std::make_pair(InstanceName,Type);
533  }
534  for(auto const& showerassnPtr: showerassnPtrs){
535  const std::string Type = (showerassnPtr.second)->GetType();
536  const std::string InstanceName = (showerassnPtr.second)->GetInstanceName();
537  Type_showerassnPtrs[showerassnPtr.first] = std::make_pair(InstanceName,Type);
538  }
539 
540  unsigned int maxtype = 0;
541  unsigned int maxinstname = 0;
542  for(auto const& Type_showerprodPtr: Type_showerprodPtrs){
543  if(Type_showerprodPtr.second.second.size() > maxtype){
544  maxtype = Type_showerprodPtr.second.second.size();
545  }
546  if(Type_showerprodPtr.second.first.size() > maxinstname){
547  maxinstname = Type_showerprodPtr.second.first.size();
548  }
549  }
550  for(auto const& Type_showerassnPtr: Type_showerassnPtrs){
551  if(Type_showerassnPtr.second.second.size() > maxtype){
552  maxtype = Type_showerassnPtr.second.second.size();
553  }
554  if(Type_showerassnPtr.second.first.size() > maxinstname){
555  maxinstname = Type_showerassnPtr.second.first.size();
556  }
557  }
558 
559  unsigned int n = maxname + maxtype + maxinstname + 51;
560  std::cout << std::left << std::setfill('*') << std::setw(n-1) << "**" <<std::endl;
561  std::cout << "Unique Ptrs that are added to the event" << std::endl;
562  std::cout << std::left << std::setfill('*') << std::setw(n-1) << "**" <<std::endl;
563  for(auto const& Type_showerprodPtr: Type_showerprodPtrs){
564  std::cout << std::left << std::setfill(' ') << std::setw(21) << "* Data Product Name: " << std::setw(maxname) << Type_showerprodPtr.first;
565  std::cout << std::left << std::setfill(' ') << " * Instance Name: " << std::setw(maxinstname) << Type_showerprodPtr.second.first;
566  std::cout << std::left << std::setfill(' ') << " * Type: " << std::setw(maxtype) << Type_showerprodPtr.second.second << " *" << std::endl;
567  }
568  for(auto const& Type_showerassnPtr: Type_showerassnPtrs){
569  std::cout << std::left << std::setfill(' ') << std::setw(maxname) << std::setw(21) << "* Association Name: " << std::setw(maxname) << Type_showerassnPtr.first;
570  std::cout << std::left << std::setfill(' ') << " * Instance Name: " << std::setw(maxinstname) << Type_showerassnPtr.second.first;
571  std::cout << std::left << std::setfill(' ') << " * Type: " << std::setw(maxtype) << Type_showerassnPtr.second.second<< " *" << std::endl;
572  }
573  std::cout << std::left << std::setfill('*') << std::setw(n-1) << "**" <<std::endl;
574  std::cout << std::setfill(' ');
575  std::cout << std::setw(0);
576  return;
577  }
578 
579 
580 
581  private:
582 
583  //Function to check that a data product does not already exist with the same instance name
584  template <class T>
585  bool CheckForMultipleTypes(type<T>, const std::string& Name, const std::string& Instance) const {
586 
587  //Check the a product of the same does not exist without a different instance name
588  for(auto const& assn: showerassnPtrs){
589  reco::shower::ShowerUniqueAssnPtr<T>* assnptr = dynamic_cast<reco::shower::ShowerUniqueAssnPtr<T> *>(assn.second.get());
590  if(assnptr != nullptr){
591  if(assnptr->GetInstanceName() == Instance){return false;}
592  }
593  }
594  return true;
595  }
596 
597  //Function to check that a data product does not already exist with the same instance name
598  template <class T>
599  bool CheckForMultipleTypes(type<std::vector<T> >, const std::string& Name, const std::string& Instance) const{
600 
601  //Check the a product of the same does not exist without a different instance name
602  for(auto const& product: showerproductPtrs){
604  if(prod != nullptr){
605  if(prod->GetInstanceName() == Instance){return false;}
606  }
607  }
608  return true;
609  }
610 
611 
612 
613  //Holder of the data objects of type std::vector<T> that will be saved in the events.
614  std::map<std::string,std::unique_ptr<reco::shower::ShowerUniqueProduerPtrBase > > showerproductPtrs;
615 
616  //Holder of the data objects of type T that will be saved into the events. I think these will only be assns.
617  std::map<std::string,std::unique_ptr<reco::shower::ShowerUniqueProduerPtrBase > > showerassnPtrs;
618 
619  //Holder of the ptrMakers whcih make the art::Ptrs of the data objects that lie in showerproductPtrs.
620  std::map<std::string,std::unique_ptr<reco::shower::ShowerPtrMakerBase> > showerPtrMakers;
621 };
622 
623 
624 
625 #endif
static QCString name
Definition: declinfo.cpp:673
void AddDataProduct(const reco::shower::ShowerElementHolder &selement_holder, const std::string &Name) override
art::PtrMaker< T > & GetPtrMaker(const std::string &Name)
art::Ptr< T > GetArtPtr(int iter) const
int Type
Definition: 018_def.c:12
std::string string
Definition: nybbler.cc:12
bool CheckForMultipleTypes(type< std::vector< T > >, const std::string &Name, const std::string &Instance) const
void AddDataProducts(const reco::shower::ShowerElementHolder &selement_holder)
ChannelGroupService::Name Name
std::unique_ptr< art::PtrMaker< T > > ptrmaker
STL namespace.
int SetShowerUniqueProduerPtr(type< std::vector< T > >, const std::string &Name, const std::string &Instance="")
void SetPtrMaker(art::Event &evt) override
ShowerPtrMaker(const std::string &Instancename)
MaybeLogger_< ELseverityLevel::ELsev_error, false > LogError
void PrintPtr(const std::string &Name) const
bool CheckUniqueProduerPtr(const std::string &Name) const
void MoveToEvent(art::Event &evt) override
std::map< std::string, std::unique_ptr< reco::shower::ShowerUniqueProduerPtrBase > > showerproductPtrs
std::map< std::string, std::unique_ptr< reco::shower::ShowerUniqueProduerPtrBase > > showerassnPtrs
QTextStream & reset(QTextStream &s)
std::string GetInstanceName() const override
void AddSingle(A &a, B &b, const std::string &Name)
std::void_t< T > n
const double a
def move(depos, offset)
Definition: depos.py:107
bool CheckElement(const std::string &Name) const
ProductID put(std::unique_ptr< PROD > &&edp, std::string const &instance={})
Definition: DataViewImpl.h:686
int GetElement(const std::string &Name, T &Element) const
void err(const char *fmt,...)
Definition: message.cpp:226
Q_EXPORT QTSManip setw(int w)
Definition: qtextstream.h:331
bool CheckAllProducedElements(reco::shower::ShowerElementHolder &selement_holder) const
void AddDataProduct(const reco::shower::ShowerElementHolder &selement_holder, const std::string &Name) override
MaybeLogger_< ELseverityLevel::ELsev_warning, false > LogWarning
static bool * b
Definition: config.cpp:1043
ShowerUniqueAssnPtr(const std::string &Instancename)
art::Ptr< T > GetArtPtr(const std::string &Name, const int &iter) const
TCEvent evt
Definition: DataStructs.cxx:7
std::map< std::string, std::unique_ptr< reco::shower::ShowerPtrMakerBase > > showerPtrMakers
int SetShowerUniqueProduerPtr(type< T >, const std::string &Name, const std::string &Instance="")
Q_EXPORT QTSManip setfill(int f)
Definition: qtextstream.h:337
bool CheckForMultipleTypes(type< T >, const std::string &Name, const std::string &Instance) const
Definition: fwd.h:31
int GetVectorPtrSize(const std::string &Name) const
cet::coded_exception< error, detail::translate > exception
Definition: exception.h:33
QTextStream & endl(QTextStream &s)