CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
TrackProbabilityXMLtoDB.cc
Go to the documentation of this file.
1 // -*- C++ -*-
2 //
3 // Package: TrackProbabilityXMLtoDB
4 // Class: TrackProbabilityXMLtoDB
5 //
13 //
14 // Original Author: Andrea Rizzi
15 // Created: Wed Apr 12 11:12:49 CEST 2006
16 // $Id: TrackProbabilityXMLtoDB.cc,v 1.3 2010/02/25 00:32:04 wmtan Exp $
17 //
18 //
19 
20 
21 
22 
23 // system include files
24 #include <memory>
25 #include <string>
26 #include <iostream>
27 using namespace std;
28 
29 // user include files
36 
43 
44 //#include "RecoBTag/TrackProbability/interface/TrackClassFilterCategory.h"
45 
48 //#include "TrackProbabilityCalibratedHistogram.h"
49 
53 
54 //CondFormats
56 
60 // Math
61 #include "Math/GenVector/VectorUtil.h"
62 #include "Math/GenVector/PxPyPzE4D.h"
63 
66 #include "RecoBTag/TrackProbability/interface/TrackClassFilterCategory.h"
67 
68 //#include "TH1F.h"
69 //#include "TFile.h"
70 
71 
72 #include <fstream>
73 #include <iostream>
74 
75 using namespace reco;
76 
77 //
78 // class decleration
79 //
80 
82  public:
84 
85  virtual void endJob()
86  {
88  if( !mydbservice.isAvailable() ) return;
89 
90  edm::FileInPath f2d("RecoBTag/TrackProbability/data/2DHisto.xml");
91  edm::FileInPath f3d("RecoBTag/TrackProbability/data/3DHisto.xml");
94 
95  vector<pair<TrackClassFilterCategory, CalibratedHistogramXML> > data = calibrationOld->categoriesWithData();
96  vector<pair<TrackClassFilterCategory, CalibratedHistogramXML> > data2d = calibration2dOld->categoriesWithData();
99  for(int i = 0 ; i < data.size();i++)
100  {
102  entry.category=data[i].first.categoryData();
103  entry.histogram=data[i].second;
104  calibration->data.push_back(entry);
105  }
106  for(int i = 0 ; i < data2d.size();i++)
107  {
109  entry.category=data2d[i].first.categoryData();
110  entry.histogram=data2d[i].second;
111  calibration2d->data.push_back(entry);
112  }
113 
114 
115  mydbservice->createNewIOV<TrackProbabilityCalibration>(calibration, mydbservice->endOfTime(),"BTagTrackProbability3DRcd");
116 
117  mydbservice->createNewIOV<TrackProbabilityCalibration>(calibration2d, mydbservice->endOfTime(),"BTagTrackProbability2DRcd");
118 
119 
120  }
122  {
123  }
124 
125 
126 
127  virtual void analyze(const edm::Event& iEvent, const edm::EventSetup& iSetup);
128 
129  private:
130  int count;
134  double m_cutMaxTIP;
135  double m_cutMinPt;
138  double m_cutMaxLIP;
140  double m_cutMinProb;
141 
145 };
146 
147 //
148 // constructors and destructor
149 //
151 {
152 }
153 
154 void
156 {
157 }
158 
159 //define this as a plug-in
160 
int i
Definition: DBlmapReader.cc:9
dictionary parameters
Definition: Parameters.py:2
#define DEFINE_FWK_MODULE(type)
Definition: MakerMacros.h:17
virtual void analyze(const edm::Event &iEvent, const edm::EventSetup &iSetup)
int iEvent
Definition: GenABIO.cc:243
std::pair< std::string, MonitorElement * > entry
Definition: ME_MAP.h:8
bool isAvailable() const
Definition: Service.h:47
const std::vector< std::pair< T, CO > > & categoriesWithData() const
void createNewIOV(T *firstPayloadObj, cond::Time_t firstSinceTime, cond::Time_t firstTillTime, const std::string &recordName, bool withlogging=false)
TrackProbabilityXMLtoDB(const edm::ParameterSet &)
PhysicsTools::Calibration::HistogramF histogram
char data[epos_bytes_allocation]
Definition: EPOS_Wrapper.h:82
std::string fullPath() const
Definition: FileInPath.cc:171