eventAnalysis  7.0-49-g0ac7482
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Pages
TTagsModule.cxx
Go to the documentation of this file.
1 ///
2 /// For questions or suggestions about this module please contact the
3 /// current responsible and CC in the eventAnalysis package manager.
4 ///
5 /// 23-May-2014: Current responsible for this module is,
6 /// Luke Pickering (lp208 [*a*t*] ic.ac.uk)
7 // include to get environment variables for software version
8 #include <cstdlib>
9 #include "TString.h"
10 #include "TTagsModule.hxx"
11 #include "../cvstags/TTagsModule.cxx"
12 
14  const char *title) {
15  SetNameTitle(name, title);
16 // Enable this module by default:
17  fIsEnabled = kTRUE;
18  fDescription =
19  "Standard module which stores any information from the /tags section "
20  "in an event";
22  fCVSID = CVSID;
23  ND::TFieldManager::InitializeFieldManager();
24 }
26 Bool_t ND::TTagsModule::Configure(std::string &option) {
27  ND280NamedWarn("TTagsModule"," Configure");
28  ND280NamedWarn("TTagsModule"," options"<<option);
29  return true;
30 }
32 // TAG INFO
33  fOutputTree->Branch("Tags", &fTags);
34  fOutputTree->Branch("Jobs", &fJobs);
35 }
36 bool ND::TTagsModule::FillTree(ND::TND280Event &event) {
37  fTags.clear();
38  fJobs.clear();
39  ND280Warn(" entered ND::TTagsModule::FillTree ");
40 // Get all the tags
41  ND::THandle<ND::TDataVector> tags = event.Get<ND::TDataVector>("tags");
42  if(tags)
43  {
44 // Get the top level tags and store them infTags
45  for (ND::TDataVector::iterator element = tags->begin(); element != tags->end(); ++element)
46  {
47  ND::TND280Tags* thisTag=dynamic_cast<ND::TND280Tags*> (*element);
48  if(thisTag){
49  ND::TND280Tags::tagsMap M=thisTag->GetMap();
50  M["TAG:"]=Form("%s:%s",thisTag->GetName(),thisTag->GetTitle());
51  fTags.push_back(M);
52  }
53  }
54 // Get the job information and store it in fJobs
55  ND::THandle<ND::TDataVector> jobs = event.Get<ND::TDataVector>("tags/jobs");
56  if(jobs)
57  {
58  int iJob=0;
59  for (ND::TDataVector::iterator element = jobs->begin(); element != jobs->end(); ++element)
60  {
61  ND::TND280Tags* thisJob=dynamic_cast<ND::TND280Tags*> (*element);
62  if(thisJob){
63  ND::TND280Tags::tagsMap M=thisJob->GetMap();
64  M[Form("JOB: %d",iJob++)]=Form("%s:%s",thisJob->GetName(),thisJob->GetTitle());
65  fJobs.push_back(M);
66  }
67  }
68  }
69  }
70  return true;
71 }
72 Bool_t ND::TTagsModule::ProcessFirstEvent(ND::TND280Event &) {
73  return true;
74 }
virtual Bool_t ProcessFirstEvent(ND::TND280Event &)
Is called after the first event is loaded in.
Definition: TTagsModule.cxx:72
#define CVSID
std::string fDescription
A longish descrition of the analysis.
TTagsModule(const char *name="Tags", const char *title="Tags Module")
For questions or suggestions about this module please contact the current responsible and CC in the e...
Definition: TTagsModule.cxx:13
virtual ~TTagsModule()
Definition: TTagsModule.cxx:25
virtual bool FillTree(ND::TND280Event &)
Fill all the stuff that goes in the output tree.
Definition: TTagsModule.cxx:36
std::string fCVSID
Defined if an official tagged version.
void SetNameTitle(char const *name, char const *title)
Bool_t Configure(std::string &)
A function that allows the module to be configured from an external class without any dependencies...
Definition: TTagsModule.cxx:26
std::string fCVSTagName
Defined if an official tagged version.
#define CVSTAG
virtual void InitializeBranches()
Initialize Branches. Don&#39;t do anything else in this function.
Definition: TTagsModule.cxx:31

Package Summary
Package Name: eventAnalysis
Package Version: 7.0-49-g0ac7482
Package Manager:

Generated on Mon Mar 25 2024 14:43:59 for eventAnalysis by doxygen 1.8.5