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 const &)=delete
 
 EDConsumerBase (EDConsumerBase &&)=default
 
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
 
EDConsumerBase const & operator= (EDConsumerBase const &)=delete
 
EDConsumerBaseoperator= (EDConsumerBase &&)=default
 
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
template<typename ProductType , BranchType B = InEvent>
EDGetTokenT< ProductType > consumes (edm::InputTag const &tag)
 
EDGetToken consumes (const TypeToGet &id, 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)
 
template<typename ProductType , BranchType B = InEvent>
EDGetTokenT< ProductType > mayConsume (edm::InputTag const &tag)
 
EDGetToken mayConsume (const TypeToGet &id, edm::InputTag const &tag)
 
template<BranchType B>
EDGetToken mayConsume (const TypeToGet &id, 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 ( const edm::ParameterSet p)

Definition at line 30 of file PhysicsPerformanceDBWriterFromFile_WPandPayload_IOV.cc.

References edm::ParameterSet::getParameter(), edm::ParameterSet::getUntrackedParameter(), inputTxtFile, iovBegin, iovEnd, rec1, rec2, and AlCaHLTBitMon_QueryRunRegistry::string.

PhysicsPerformanceDBWriterFromFile_WPandPayload_IOV::~PhysicsPerformanceDBWriterFromFile_WPandPayload_IOV ( )
inlineoverride

Definition at line 22 of file PhysicsPerformanceDBWriterFromFile_WPandPayload_IOV.cc.

22 {}

Member Function Documentation

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

Definition at line 20 of file PhysicsPerformanceDBWriterFromFile_WPandPayload_IOV.cc.

20 {}
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.

References cond::service::PoolDBOutputService::appendSinceTime(), newFWLiteAna::bin, comment, gather_cfg::cout, cond::service::PoolDBOutputService::createNewIOV(), TkAlMuonSelectors_cfi::cut, DEFINE_FWK_MODULE, recoMuon::in, inputTxtFile, iovBegin, iovEnd, edm::Service< T >::isAvailable(), cond::service::PoolDBOutputService::isNewTagRequest(), ZMuMuCategoriesSequences_cff::nbin, contentValuesFiles::number, rec1, rec2, alignCSCRings::s, AlCaHLTBitMon_QueryRunRegistry::string, groupFilesInBlocks::temp, and createJobs::tmp.

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;
92  res.push_back((PerformanceResult::ResultType)(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;
102  bin.push_back((BinningVariables::BinningVariablesType)(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 
141  PerformanceWorkingPoint* wp = new PerformanceWorkingPoint(cut, tagger);
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 {
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)) {
176  // s->beginOfTime(),
177  // s->endOfTime(),
178  iovBegin,
179  iovEnd,
180  rec2);
181  } else {
184  // 111,
185  iovBegin,
186  rec2);
187  }
188  }
189 }
Definition: Electron.h:6
void appendSinceTime(T *payloadObj, cond::Time_t sinceTime, const std::string &recordName, bool withlogging=false)
bool isNewTagRequest(const std::string &recordName)
bool isAvailable() const
Definition: Service.h:40
void createNewIOV(T *firstPayloadObj, cond::Time_t firstSinceTime, cond::Time_t firstTillTime, const std::string &recordName, bool withlogging=false)
tmp
align.sh
Definition: createJobs.py:716
#define comment(par)
Definition: vmac.h:163
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

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