CMS 3D CMS Logo

List of all members | Public Member Functions | Private Attributes
PhysicsPerformanceDBWriterFromFile_WPandPayload_IOV Class Reference
Inheritance diagram for PhysicsPerformanceDBWriterFromFile_WPandPayload_IOV:
edm::EDAnalyzer edm::EDConsumerBase

Public Member Functions

void analyze (const edm::Event &, const edm::EventSetup &) override
 
void beginJob () override
 
void endJob () override
 
 PhysicsPerformanceDBWriterFromFile_WPandPayload_IOV (const edm::ParameterSet &)
 
 ~PhysicsPerformanceDBWriterFromFile_WPandPayload_IOV () override
 
- Public Member Functions inherited from edm::EDAnalyzer
void callWhenNewProductsRegistered (std::function< void(BranchDescription const &)> const &func)
 
 EDAnalyzer ()
 
SerialTaskQueueglobalLuminosityBlocksQueue ()
 
SerialTaskQueueglobalRunsQueue ()
 
ModuleDescription const & moduleDescription () const
 
std::string workerType () const
 
 ~EDAnalyzer () override
 
- Public Member Functions inherited from edm::EDConsumerBase
std::vector< ConsumesInfoconsumesInfo () const
 
void convertCurrentProcessAlias (std::string const &processName)
 Convert "@currentProcess" in InputTag process names to the actual current process name. More...
 
 EDConsumerBase ()
 
 EDConsumerBase (EDConsumerBase &&)=default
 
 EDConsumerBase (EDConsumerBase const &)=delete
 
ESProxyIndex const * esGetTokenIndices (edm::Transition iTrans) const
 
ProductResolverIndexAndSkipBit indexFrom (EDGetToken, BranchType, TypeID const &) const
 
void itemsMayGet (BranchType, std::vector< ProductResolverIndexAndSkipBit > &) const
 
void itemsToGet (BranchType, std::vector< ProductResolverIndexAndSkipBit > &) const
 
std::vector< ProductResolverIndexAndSkipBit > const & itemsToGetFrom (BranchType iType) const
 
void labelsForToken (EDGetToken iToken, Labels &oLabels) const
 
void modulesWhoseProductsAreConsumed (std::vector< ModuleDescription const * > &modules, ProductRegistry const &preg, std::map< std::string, ModuleDescription const * > const &labelsToDesc, std::string const &processName) const
 
EDConsumerBaseoperator= (EDConsumerBase &&)=default
 
EDConsumerBase const & operator= (EDConsumerBase const &)=delete
 
bool registeredToConsume (ProductResolverIndex, bool, BranchType) const
 
bool registeredToConsumeMany (TypeID const &, BranchType) const
 
ProductResolverIndexAndSkipBit uncheckedIndexFrom (EDGetToken) const
 
void updateLookup (BranchType iBranchType, ProductResolverIndexHelper const &, bool iPrefetchMayGet)
 
void updateLookup (eventsetup::ESRecordsToProxyIndices const &)
 
virtual ~EDConsumerBase () noexcept(false)
 

Private Attributes

std::string inputTxtFile
 
unsigned long long iovBegin
 
unsigned long long iovEnd
 
std::string rec1
 
std::string rec2
 

Additional Inherited Members

- Public Types inherited from edm::EDAnalyzer
typedef EDAnalyzer ModuleType
 
- Public Types inherited from edm::EDConsumerBase
typedef ProductLabels Labels
 
- Static Public Member Functions inherited from edm::EDAnalyzer
static const std::string & baseType ()
 
static void fillDescriptions (ConfigurationDescriptions &descriptions)
 
static void prevalidate (ConfigurationDescriptions &)
 
static bool wantsGlobalLuminosityBlocks ()
 
static bool wantsGlobalRuns ()
 
static bool wantsStreamLuminosityBlocks ()
 
static bool wantsStreamRuns ()
 
- Protected Member Functions inherited from edm::EDConsumerBase
EDGetToken consumes (const TypeToGet &id, edm::InputTag const &tag)
 
template<typename ProductType , BranchType B = InEvent>
EDGetTokenT< ProductType > consumes (edm::InputTag const &tag)
 
template<BranchType B>
EDGetToken consumes (TypeToGet const &id, edm::InputTag const &tag)
 
ConsumesCollector consumesCollector ()
 Use a ConsumesCollector to gather consumes information from helper functions. More...
 
template<typename ProductType , BranchType B = InEvent>
void consumesMany ()
 
void consumesMany (const TypeToGet &id)
 
template<BranchType B>
void consumesMany (const TypeToGet &id)
 
template<typename ESProduct , typename ESRecord , Transition Tr = Transition::Event>
auto esConsumes ()
 
template<typename ESProduct , typename ESRecord , Transition Tr = Transition::Event>
auto esConsumes (ESInputTag const &tag)
 
EDGetToken mayConsume (const TypeToGet &id, edm::InputTag const &tag)
 
template<BranchType B>
EDGetToken mayConsume (const TypeToGet &id, edm::InputTag const &tag)
 
template<typename ProductType , BranchType B = InEvent>
EDGetTokenT< ProductType > mayConsume (edm::InputTag const &tag)
 

Detailed Description

Definition at line 16 of file PhysicsPerformanceDBWriterFromFile_WPandPayload_IOV.cc.

Constructor & Destructor Documentation

◆ PhysicsPerformanceDBWriterFromFile_WPandPayload_IOV()

PhysicsPerformanceDBWriterFromFile_WPandPayload_IOV::PhysicsPerformanceDBWriterFromFile_WPandPayload_IOV ( const edm::ParameterSet p)

Definition at line 30 of file PhysicsPerformanceDBWriterFromFile_WPandPayload_IOV.cc.

31  {
32  inputTxtFile = p.getUntrackedParameter<std::string>("inputTxtFile");
33  rec1 = p.getUntrackedParameter<std::string>("RecordPayload");
34  rec2 = p.getUntrackedParameter<std::string>("RecordWP");
35  iovBegin = p.getParameter<unsigned long long>("IOVBegin");
36  iovEnd = p.getParameter<unsigned long long>("IOVEnd");
37 }

References inputTxtFile, iovBegin, iovEnd, AlCaHLTBitMon_ParallelJobs::p, rec1, rec2, and AlCaHLTBitMon_QueryRunRegistry::string.

◆ ~PhysicsPerformanceDBWriterFromFile_WPandPayload_IOV()

PhysicsPerformanceDBWriterFromFile_WPandPayload_IOV::~PhysicsPerformanceDBWriterFromFile_WPandPayload_IOV ( )
inlineoverride

Definition at line 22 of file PhysicsPerformanceDBWriterFromFile_WPandPayload_IOV.cc.

22 {}

Member Function Documentation

◆ analyze()

void PhysicsPerformanceDBWriterFromFile_WPandPayload_IOV::analyze ( const edm::Event ,
const edm::EventSetup  
)
inlineoverridevirtual

Implements edm::EDAnalyzer.

Definition at line 20 of file PhysicsPerformanceDBWriterFromFile_WPandPayload_IOV.cc.

20 {}

◆ beginJob()

void PhysicsPerformanceDBWriterFromFile_WPandPayload_IOV::beginJob ( void  )
overridevirtual

JUST A STUPID PATCH

Reimplemented from edm::EDAnalyzer.

Definition at line 39 of file PhysicsPerformanceDBWriterFromFile_WPandPayload_IOV.cc.

39  {
40  //
41  // read object from file
42  //
43 
44  //
45  // File Format is
46  // - tagger name
47  // - cut
48  // - concrete class name
49  // - how many results and how many binning
50  // - their values
51  // - vector<float>
52  //
53 
54  std::ifstream in;
55  in.open(inputTxtFile.c_str());
56  std::string tagger;
57  float cut;
58 
59  std::string concreteType;
61  std::vector<float> pl;
62  int stride;
63 
64  in >> tagger;
65  std::cout << "WP Tagger is " << tagger << std::endl;
66 
67  in >> cut;
68  std::cout << "WP Cut is " << cut << std::endl;
69 
70  in >> concreteType;
71  std::cout << "concrete Type is " << concreteType << std::endl;
72 
73  // return ;
74 
75  // read # of results
76 
77  int nres, nbin;
78  in >> nres;
79  in >> nbin;
80  std::cout << " Results: " << nres << " Binning variables: " << nbin << std::endl;
81 
82  stride = nres + nbin * 2;
83 
84  int number = 0;
85 
86  std::vector<PerformanceResult::ResultType> res;
87  std::vector<BinningVariables::BinningVariablesType> bin;
88 
89  while (number < nres && !in.eof()) {
90  int tmp;
91  in >> tmp;
93  number++;
94  }
95  if (number != nres) {
96  std::cout << " Table not well formed" << std::endl;
97  }
98  number = 0;
99  while (number < nbin && !in.eof()) {
100  int tmp;
101  in >> tmp;
103  number++;
104  }
105  if (number != nbin) {
106  std::cout << " Table not well formed" << std::endl;
107  }
108 
109  number = 0;
110  while (!in.eof()) {
111  float temp;
112  in >> temp;
113  std::cout << " Inserting " << temp << " in position " << number << std::endl;
114  number++;
115  pl.push_back(temp);
116  }
117 
118  //
119  // CHECKS
120  //
121  if (stride != nbin * 2 + nres) {
122  std::cout << " Table not well formed" << std::endl;
123  }
124  if (stride != 0 && (number % stride) != 0) {
125  std::cout << " Table not well formed" << std::endl;
126  }
127 
128  in.close();
129 
130  /* for (int k=0;k<(number/stride); k++){
131  for (int j=0; j<stride; j++){
132  std::cout << "Pos["<<k<<","<<j<<"] = "<<pl[k*stride+j]<<std::endl;
133  }
134  }
135  */
136 
137  //
138  // now create pl etc etc
139  //
140 
142 
143  PerformancePayloadFromTable* btagpl = nullptr;
144 
145  if (concreteType == "PerformancePayloadFromTable") {
146  btagpl = new PerformancePayloadFromTable(res, bin, stride, pl);
147  } else {
148  std::cout << " Non existing request: " << concreteType << std::endl;
149  }
150 
151  std::cout << " Created the " << concreteType << " object" << std::endl;
152 
154  if (s.isAvailable()) {
155  if (s->isNewTagRequest(rec1)) {
156  s->createNewIOV<PerformancePayload>(btagpl,
157  // s->beginOfTime(),
158  // s->endOfTime(),
159  iovBegin,
160  iovEnd,
161  rec1);
162  } else {
163  s->appendSinceTime<PerformancePayload>(btagpl,
164  // JUST A STUPID PATCH
165  // 111,
166  iovBegin,
167  rec1);
168  }
169  }
170 
171  // write also the WP
172 
173  if (s.isAvailable()) {
174  if (s->isNewTagRequest(rec2)) {
175  s->createNewIOV<PerformanceWorkingPoint>(wp,
176  // s->beginOfTime(),
177  // s->endOfTime(),
178  iovBegin,
179  iovEnd,
180  rec2);
181  } else {
182  s->appendSinceTime<PerformanceWorkingPoint>(wp,
184  // 111,
185  iovBegin,
186  rec2);
187  }
188  }
189 }

References newFWLiteAna::bin, comment, gather_cfg::cout, TkAlMuonSelectors_cfi::cut, recoMuon::in, inputTxtFile, iovBegin, iovEnd, ZMuMuCategoriesSequences_cff::nbin, contentValuesFiles::number, rec1, rec2, alignCSCRings::s, AlCaHLTBitMon_QueryRunRegistry::string, groupFilesInBlocks::temp, createJobs::tmp, and pfClustersFromHGC3DClusters_cfi::wp.

◆ endJob()

void PhysicsPerformanceDBWriterFromFile_WPandPayload_IOV::endJob ( void  )
inlineoverridevirtual

Reimplemented from edm::EDAnalyzer.

Definition at line 21 of file PhysicsPerformanceDBWriterFromFile_WPandPayload_IOV.cc.

21 {}

Member Data Documentation

◆ inputTxtFile

std::string PhysicsPerformanceDBWriterFromFile_WPandPayload_IOV::inputTxtFile
private

◆ iovBegin

unsigned long long PhysicsPerformanceDBWriterFromFile_WPandPayload_IOV::iovBegin
private

◆ iovEnd

unsigned long long PhysicsPerformanceDBWriterFromFile_WPandPayload_IOV::iovEnd
private

◆ rec1

std::string PhysicsPerformanceDBWriterFromFile_WPandPayload_IOV::rec1
private

◆ rec2

std::string PhysicsPerformanceDBWriterFromFile_WPandPayload_IOV::rec2
private
TkAlMuonSelectors_cfi.cut
cut
Definition: TkAlMuonSelectors_cfi.py:5
PerformanceWorkingPoint
Definition: PerformanceWorkingPoint.h:8
pfClustersFromHGC3DClusters_cfi.wp
wp
Definition: pfClustersFromHGC3DClusters_cfi.py:30
AlCaHLTBitMon_ParallelJobs.p
p
Definition: AlCaHLTBitMon_ParallelJobs.py:153
gather_cfg.cout
cout
Definition: gather_cfg.py:144
PhysicsPerformanceDBWriterFromFile_WPandPayload_IOV::rec2
std::string rec2
Definition: PhysicsPerformanceDBWriterFromFile_WPandPayload_IOV.cc:26
PhysicsPerformanceDBWriterFromFile_WPandPayload_IOV::iovBegin
unsigned long long iovBegin
Definition: PhysicsPerformanceDBWriterFromFile_WPandPayload_IOV.cc:27
createJobs.tmp
tmp
align.sh
Definition: createJobs.py:716
groupFilesInBlocks.temp
list temp
Definition: groupFilesInBlocks.py:142
alignCSCRings.s
s
Definition: alignCSCRings.py:92
PerformancePayloadFromTable
Definition: PerformancePayloadFromTable.h:15
contentValuesFiles.number
number
Definition: contentValuesFiles.py:53
PerformancePayload
Definition: PerformancePayload.h:14
AlCaHLTBitMon_QueryRunRegistry.string
string
Definition: AlCaHLTBitMon_QueryRunRegistry.py:256
PerformanceResult::ResultType
ResultType
Definition: PerformanceResult.h:8
recoMuon::in
Definition: RecoMuonEnumerators.h:6
edm::Service< cond::service::PoolDBOutputService >
res
Definition: Electron.h:6
PhysicsPerformanceDBWriterFromFile_WPandPayload_IOV::iovEnd
unsigned long long iovEnd
Definition: PhysicsPerformanceDBWriterFromFile_WPandPayload_IOV.cc:27
newFWLiteAna.bin
bin
Definition: newFWLiteAna.py:161
comment
#define comment(par)
Definition: vmac.h:163
ZMuMuCategoriesSequences_cff.nbin
nbin
Definition: ZMuMuCategoriesSequences_cff.py:25
PhysicsPerformanceDBWriterFromFile_WPandPayload_IOV::inputTxtFile
std::string inputTxtFile
Definition: PhysicsPerformanceDBWriterFromFile_WPandPayload_IOV.cc:25
PhysicsPerformanceDBWriterFromFile_WPandPayload_IOV::rec1
std::string rec1
Definition: PhysicsPerformanceDBWriterFromFile_WPandPayload_IOV.cc:26
BinningVariables::BinningVariablesType
BinningVariablesType
Definition: BinningVariables.h:10