CMS 3D CMS Logo

List of all members | Public Member Functions | Protected Member Functions | Private Member Functions | Private Attributes
Vx3DHLTAnalyzer Class Reference

#include <Vx3DHLTAnalyzer.h>

Inheritance diagram for Vx3DHLTAnalyzer:
DQMEDAnalyzer edm::stream::EDAnalyzer< edm::RunSummaryCache< dqmDetails::NoCache >, edm::LuminosityBlockSummaryCache< dqmDetails::NoCache > > edm::stream::EDAnalyzerBase edm::EDConsumerBase

Public Member Functions

 Vx3DHLTAnalyzer (const edm::ParameterSet &)
 
 ~Vx3DHLTAnalyzer ()
 
- Public Member Functions inherited from DQMEDAnalyzer
virtual void beginRun (edm::Run const &, edm::EventSetup const &) final
 
virtual void beginStream (edm::StreamID id) final
 
virtual void dqmBeginRun (edm::Run const &, edm::EventSetup const &)
 
 DQMEDAnalyzer (void)
 
virtual void endLuminosityBlockSummary (edm::LuminosityBlock const &, edm::EventSetup const &, dqmDetails::NoCache *) const final
 
virtual void endRunSummary (edm::Run const &, edm::EventSetup const &, dqmDetails::NoCache *) const final
 
uint32_t streamId () const
 
- Public Member Functions inherited from edm::stream::EDAnalyzer< edm::RunSummaryCache< dqmDetails::NoCache >, edm::LuminosityBlockSummaryCache< dqmDetails::NoCache > >
 EDAnalyzer ()=default
 
- Public Member Functions inherited from edm::stream::EDAnalyzerBase
void callWhenNewProductsRegistered (std::function< void(BranchDescription const &)> const &func)
 
 EDAnalyzerBase ()
 
ModuleDescription const & moduleDescription () const
 
virtual ~EDAnalyzerBase ()
 
- Public Member Functions inherited from edm::EDConsumerBase
std::vector< ConsumesInfoconsumesInfo () const
 
 EDConsumerBase ()
 
 EDConsumerBase (EDConsumerBase const &)=delete
 
 EDConsumerBase (EDConsumerBase &&)=default
 
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
 
void updateLookup (BranchType iBranchType, ProductResolverIndexHelper const &, bool iPrefetchMayGet)
 
virtual ~EDConsumerBase () noexcept(false)
 

Protected Member Functions

double Gauss3DFunc (const double *par)
 
- 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 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)
 

Private Member Functions

void analyze (const edm::Event &iEvent, const edm::EventSetup &iSetup) override
 
void beginLuminosityBlock (const edm::LuminosityBlock &lumiBlock, const edm::EventSetup &iSetup) override
 
void bookHistograms (DQMStore::IBooker &, edm::Run const &, edm::EventSetup const &) override
 
void endLuminosityBlock (const edm::LuminosityBlock &lumiBlock, const edm::EventSetup &iSetup) override
 
std::string formatTime (const time_t &t)
 
unsigned int HitCounter (const edm::Event &iEvent)
 
int MyFit (std::vector< double > *vals)
 
void printFitParams (const std::vector< double > &fitResults)
 
void reset (std::string ResetType)
 
void writeToFile (std::vector< double > *vals, edm::TimeValue_t BeginTimeOfFit, edm::TimeValue_t EndTimeOfFit, unsigned int BeginLumiOfFit, unsigned int EndLumiOfFit, int dataType)
 

Private Attributes

unsigned int beginLumiOfFit
 
edm::TimeValue_t beginTimeOfFit
 
bool considerVxCovariance
 
unsigned int counterVx
 
bool dataFromFit
 
bool debugMode
 
MonitorElementdxdzlumi
 
MonitorElementdydzlumi
 
unsigned int endLumiOfFit
 
edm::TimeValue_t endTimeOfFit
 
std::string fileName
 
MonitorElementfitResults
 
MonitorElementgoodVxCounter
 
MonitorElementhitCounter
 
bool internalDebug
 
unsigned int lastLumiOfFit
 
unsigned int lumiCounter
 
double maxLongLength
 
unsigned int maxLumiIntegration
 
double maxTransRadius
 
unsigned int minNentries
 
double minVxDoF
 
double minVxWgt
 
MonitorElementmXlumi
 
MonitorElementmYlumi
 
MonitorElementmZlumi
 
unsigned int nLumiFit
 
unsigned int nLumiXaxisRange
 
unsigned int nParams
 
unsigned int numberFits
 
unsigned int numberGoodFits
 
std::ofstream outputDebugFile
 
std::ofstream outputFile
 
double pi
 
edm::EDGetTokenT< SiPixelRecHitCollectionpixelHitCollection
 
MonitorElementreportSummary
 
MonitorElementreportSummaryMap
 
unsigned int runNumber
 
MonitorElementstatusCounter
 
MonitorElementsXlumi
 
MonitorElementsYlumi
 
MonitorElementsZlumi
 
unsigned int totalHits
 
edm::EDGetTokenT< reco::VertexCollectionvertexCollection
 
std::vector< VertexTypeVertices
 
MonitorElementVx_X
 
MonitorElementVx_X_Cum
 
MonitorElementVx_XY
 
MonitorElementVx_XY_Cum
 
MonitorElementVx_Y
 
MonitorElementVx_Y_Cum
 
MonitorElementVx_Z
 
MonitorElementVx_Z_Cum
 
MonitorElementVx_ZX
 
MonitorElementVx_ZX_Cum
 
MonitorElementVx_ZY
 
MonitorElementVx_ZY_Cum
 
double VxErrCorr
 
double xPos
 
double xRange
 
double xStep
 
double yPos
 
double yRange
 
double yStep
 
double zPos
 
double zRange
 
double zStep
 

Additional Inherited Members

- Public Types inherited from edm::stream::EDAnalyzer< edm::RunSummaryCache< dqmDetails::NoCache >, edm::LuminosityBlockSummaryCache< dqmDetails::NoCache > >
typedef CacheContexts< T... > CacheTypes
 
typedef CacheTypes::GlobalCache GlobalCache
 
typedef AbilityChecker< T... > HasAbility
 
typedef CacheTypes::LuminosityBlockCache LuminosityBlockCache
 
typedef LuminosityBlockContextT< LuminosityBlockCache, RunCache, GlobalCacheLuminosityBlockContext
 
typedef CacheTypes::LuminosityBlockSummaryCache LuminosityBlockSummaryCache
 
typedef CacheTypes::RunCache RunCache
 
typedef RunContextT< RunCache, GlobalCacheRunContext
 
typedef CacheTypes::RunSummaryCache RunSummaryCache
 
- Public Types inherited from edm::stream::EDAnalyzerBase
typedef EDAnalyzerAdaptorBase ModuleType
 
- Public Types inherited from edm::EDConsumerBase
typedef ProductLabels Labels
 
- Static Public Member Functions inherited from DQMEDAnalyzer
static std::shared_ptr< dqmDetails::NoCacheglobalBeginLuminosityBlockSummary (edm::LuminosityBlock const &, edm::EventSetup const &, LuminosityBlockContext const *)
 
static std::shared_ptr< dqmDetails::NoCacheglobalBeginRunSummary (edm::Run const &, edm::EventSetup const &, RunContext const *)
 
static void globalEndLuminosityBlockSummary (edm::LuminosityBlock const &, edm::EventSetup const &, LuminosityBlockContext const *, dqmDetails::NoCache *)
 
static void globalEndRunSummary (edm::Run const &, edm::EventSetup const &, RunContext const *, dqmDetails::NoCache *)
 
- Static Public Member Functions inherited from edm::stream::EDAnalyzerBase
static const std::string & baseType ()
 
static void fillDescriptions (ConfigurationDescriptions &descriptions)
 
static void prevalidate (ConfigurationDescriptions &descriptions)
 

Detailed Description

Definition at line 48 of file Vx3DHLTAnalyzer.h.

Constructor & Destructor Documentation

Vx3DHLTAnalyzer::Vx3DHLTAnalyzer ( const edm::ParameterSet iConfig)

Definition at line 27 of file Vx3DHLTAnalyzer.cc.

References MillePedeFileConverter_cfg::fileName, edm::ParameterSet::getParameter(), edm::ParameterSet::getUntrackedParameter(), pi, particleFlowSuperClusterECAL_cfi::vertexCollection, and HiClusterCompatibility_cfi::zStep.

28 {
29  debugMode = true;
30  nLumiFit = 2; // Number of integrated lumis to perform the fit
31  maxLumiIntegration = 15; // If failing fits, this is the maximum number of integrated lumis after which a reset is issued
32  nLumiXaxisRange = 5000; // Correspond to about 32h of data taking: 32h * 60min * 60s / 23s per lumi-block = 5009
33  dataFromFit = true; // The Beam Spot data can be either taken from the histograms or from the fit results
34  minNentries = 20; // Minimum number of good vertices to perform the fit
35  xRange = 0.8; // [cm]
36  xStep = 0.001; // [cm]
37  yRange = 0.8; // [cm]
38  yStep = 0.001; // [cm]
39  zRange = 30.; // [cm]
40  zStep = 0.04; // [cm]
41  VxErrCorr = 1.3;
42  minVxDoF = 10.; // Good-vertex selection cut
43  // For vertex fitter without track-weight: d.o.f. = 2*NTracks - 3
44  // For vertex fitter with track-weight: d.o.f. = sum_NTracks(2*track_weight) - 3
45  minVxWgt = 0.5; // Good-vertex selection cut
46  fileName = "BeamPixelResults.txt";
47 
48  vertexCollection = consumes<VertexCollection> (iConfig.getUntrackedParameter<InputTag>("vertexCollection", InputTag("pixelVertices")));
49  pixelHitCollection = consumes<SiPixelRecHitCollection>(iConfig.getUntrackedParameter<InputTag>("pixelHitCollection", InputTag("siPixelRecHits")));
50 
51  debugMode = iConfig.getParameter<bool>("debugMode");
52  nLumiFit = iConfig.getParameter<unsigned int>("nLumiFit");
53  maxLumiIntegration = iConfig.getParameter<unsigned int>("maxLumiIntegration");
54  nLumiXaxisRange = iConfig.getParameter<unsigned int>("nLumiXaxisRange");
55  dataFromFit = iConfig.getParameter<bool>("dataFromFit");
56  minNentries = iConfig.getParameter<unsigned int>("minNentries");
57  xRange = iConfig.getParameter<double>("xRange");
58  xStep = iConfig.getParameter<double>("xStep");
59  yRange = iConfig.getParameter<double>("yRange");
60  yStep = iConfig.getParameter<double>("yStep");
61  zRange = iConfig.getParameter<double>("zRange");
62  zStep = iConfig.getParameter<double>("zStep");
63  VxErrCorr = iConfig.getParameter<double>("VxErrCorr");
64  minVxDoF = iConfig.getParameter<double>("minVxDoF");
65  minVxWgt = iConfig.getParameter<double>("minVxWgt");
66  fileName = iConfig.getParameter<string>("fileName");
67 
68 
69  // ### Set internal variables ###
70  nParams = 9; // Number of free parameters in the fit
71  internalDebug = false;
72  considerVxCovariance = true; // Deconvolute vertex covariance matrix
73  pi = 3.141592653589793238;
74  // ##############################
75 }
T getParameter(std::string const &) const
T getUntrackedParameter(std::string const &, T const &) const
unsigned int maxLumiIntegration
edm::EDGetTokenT< reco::VertexCollection > vertexCollection
unsigned int nLumiXaxisRange
unsigned int minNentries
edm::EDGetTokenT< SiPixelRecHitCollection > pixelHitCollection
unsigned int nParams
std::string fileName
unsigned int nLumiFit
Vx3DHLTAnalyzer::~Vx3DHLTAnalyzer ( )

Definition at line 78 of file Vx3DHLTAnalyzer.cc.

References reset().

79 {
80  reset("scratch");
81 }
void reset(std::string ResetType)

Member Function Documentation

void Vx3DHLTAnalyzer::analyze ( const edm::Event iEvent,
const edm::EventSetup iSetup 
)
overrideprivate

Definition at line 84 of file Vx3DHLTAnalyzer.cc.

References gather_cfg::cout, VertexType::Covariance, DIM, MillePedeFileConverter_cfg::fileName, edm::Event::getByToken(), edm::Event::getLuminosityBlock(), mps_fire::i, edm::EventBase::id(), edm::isNotFinite(), MillePedeFileConverter_cfg::out, reset(), edm::EventID::run(), convertSQLiteXML::runNumber, tmp, particleFlowSuperClusterECAL_cfi::vertexCollection, fftjetpfpileupcleaner_cfi::Vertices, VertexType::x, VertexType::y, and VertexType::z.

85 {
86  Handle<VertexCollection> Vx3DCollection;
87  iEvent.getByToken(vertexCollection, Vx3DCollection);
88 
89  unsigned int i,j;
90  double det;
91  VertexType MyVertex;
92 
93  if (runNumber != iEvent.id().run())
94  {
95  reset("scratch");
96  runNumber = iEvent.id().run();
97 
98  if (debugMode == true)
99  {
100  stringstream debugFile;
101  string tmp(fileName);
102 
103  if (outputDebugFile.is_open() == true) outputDebugFile.close();
104  tmp.erase(strlen(fileName.c_str())-4,4);
105  debugFile << tmp.c_str() << "_Run" << iEvent.id().run() << ".txt";
106  outputDebugFile.open(debugFile.str().c_str(), ios::out);
107  outputDebugFile.close();
108  outputDebugFile.open(debugFile.str().c_str(), ios::app);
109  }
110 
111  beginLuminosityBlock(iEvent.getLuminosityBlock(),iSetup);
112  }
113  else if (beginTimeOfFit != 0)
114  {
115  totalHits += HitCounter(iEvent);
116 
117  if (internalDebug == true)
118  {
119  cout << "[Vx3DHLTAnalyzer]::\tI found " << totalHits << " pixel hits until now" << endl;
120  cout << "[Vx3DHLTAnalyzer]::\tIn this event there are " << Vx3DCollection->size() << " vertex cadidates" << endl;
121  }
122 
123  for (vector<Vertex>::const_iterator it3DVx = Vx3DCollection->begin(); it3DVx != Vx3DCollection->end(); it3DVx++)
124  {
125  if (internalDebug == true)
126  {
127  cout << "[Vx3DHLTAnalyzer]::\tVertex selections:" << endl;
128  cout << "[Vx3DHLTAnalyzer]::\tisValid = " << it3DVx->isValid() << endl;
129  cout << "[Vx3DHLTAnalyzer]::\tisFake = " << it3DVx->isFake() << endl;
130  cout << "[Vx3DHLTAnalyzer]::\tnodof = " << it3DVx->ndof() << endl;
131  cout << "[Vx3DHLTAnalyzer]::\ttracksSize = " << it3DVx->tracksSize() << endl;
132  }
133 
134  if ((it3DVx->isValid() == true) &&
135  (it3DVx->isFake() == false) &&
136  (it3DVx->ndof() >= minVxDoF) &&
137  (it3DVx->tracksSize() > 0) &&
138  ((it3DVx->ndof()+3.) / ((double)it3DVx->tracksSize()) >= 2.*minVxWgt))
139  {
140  for (i = 0; i < DIM; i++)
141  {
142  for (j = 0; j < DIM; j++)
143  {
144  MyVertex.Covariance[i][j] = it3DVx->covariance(i,j);
145  if (isNotFinite(MyVertex.Covariance[i][j]) == true) break;
146  }
147 
148  if (j != DIM) break;
149  }
150 
151  if (i == DIM)
152  det = std::fabs(MyVertex.Covariance[0][0])*(std::fabs(MyVertex.Covariance[1][1])*std::fabs(MyVertex.Covariance[2][2]) - MyVertex.Covariance[1][2]*MyVertex.Covariance[1][2]) -
153  MyVertex.Covariance[0][1]*(MyVertex.Covariance[0][1]*std::fabs(MyVertex.Covariance[2][2]) - MyVertex.Covariance[0][2]*MyVertex.Covariance[1][2]) +
154  MyVertex.Covariance[0][2]*(MyVertex.Covariance[0][1]*MyVertex.Covariance[1][2] - MyVertex.Covariance[0][2]*std::fabs(MyVertex.Covariance[1][1]));
155 
156  if ((i == DIM) && (det > 0.))
157  {
158  if (internalDebug == true) cout << "[Vx3DHLTAnalyzer]::\tVertex accepted !" << endl;
159 
160  MyVertex.x = it3DVx->x();
161  MyVertex.y = it3DVx->y();
162  MyVertex.z = it3DVx->z();
163  Vertices.push_back(MyVertex);
164 
165  Vx_X->Fill(it3DVx->x());
166  Vx_Y->Fill(it3DVx->y());
167  Vx_Z->Fill(it3DVx->z());
168 
169  Vx_ZX->Fill(it3DVx->z(), it3DVx->x());
170  Vx_ZY->Fill(it3DVx->z(), it3DVx->y());
171  Vx_XY->Fill(it3DVx->x(), it3DVx->y());
172 
173  Vx_X_Cum->Fill(it3DVx->x());
174  Vx_Y_Cum->Fill(it3DVx->y());
175  Vx_Z_Cum->Fill(it3DVx->z());
176 
177  Vx_ZX_Cum->Fill(it3DVx->z(), it3DVx->x());
178  Vx_ZY_Cum->Fill(it3DVx->z(), it3DVx->y());
179  Vx_XY_Cum->Fill(it3DVx->x(), it3DVx->y());
180  }
181  else if (internalDebug == true)
182  {
183  cout << "[Vx3DHLTAnalyzer]::\tVertex discarded !" << endl;
184 
185  for (i = 0; i < DIM; i++)
186  for (j = 0; j < DIM; j++)
187  cout << "(i,j) --> " << i << "," << j << " --> " << MyVertex.Covariance[i][j] << endl;
188  }
189  }
190  else if (internalDebug == true) cout << "[Vx3DHLTAnalyzer]::\tVertex discarded !" << endl;
191  }
192  }
193 }
RunNumber_t run() const
Definition: EventID.h:39
MonitorElement * Vx_ZX
unsigned int totalHits
MonitorElement * Vx_Y_Cum
edm::EDGetTokenT< reco::VertexCollection > vertexCollection
bool getByToken(EDGetToken token, Handle< PROD > &result) const
Definition: Event.h:460
MonitorElement * Vx_X
edm::TimeValue_t beginTimeOfFit
unsigned int HitCounter(const edm::Event &iEvent)
void beginLuminosityBlock(const edm::LuminosityBlock &lumiBlock, const edm::EventSetup &iSetup) override
void Fill(long long x)
MonitorElement * Vx_XY
double Covariance[3][3]
bool isNotFinite(T x)
Definition: isFinite.h:10
MonitorElement * Vx_ZY
std::string fileName
MonitorElement * Vx_ZY_Cum
std::ofstream outputDebugFile
LuminosityBlock const & getLuminosityBlock() const
Definition: Event.h:86
MonitorElement * Vx_ZX_Cum
MonitorElement * Vx_Z
void reset(std::string ResetType)
MonitorElement * Vx_X_Cum
std::vector< VertexType > Vertices
#define DIM
MonitorElement * Vx_XY_Cum
std::vector< std::vector< double > > tmp
Definition: MVATrainer.cc:100
edm::EventID id() const
Definition: EventBase.h:60
unsigned int runNumber
MonitorElement * Vx_Z_Cum
MonitorElement * Vx_Y
void Vx3DHLTAnalyzer::beginLuminosityBlock ( const edm::LuminosityBlock lumiBlock,
const edm::EventSetup iSetup 
)
overrideprivate

Definition at line 890 of file Vx3DHLTAnalyzer.cc.

References edm::LuminosityBlockBase::beginTime(), edm::LuminosityBlockBase::luminosityBlock(), reset(), and edm::Timestamp::value().

891 {
892  // @@@ If statement to avoid problems with non-sequential lumisections @@@
893  if ((lumiCounter == 0) && (lumiBlock.luminosityBlock() > lastLumiOfFit))
894  {
895  beginTimeOfFit = lumiBlock.beginTime().value();
896  beginLumiOfFit = lumiBlock.luminosityBlock();
897  lumiCounter++;
898  }
899  else if ((lumiCounter != 0) && (lumiBlock.luminosityBlock() >= (beginLumiOfFit+lumiCounter))) lumiCounter++;
900  else reset("scratch");
901 }
unsigned int lumiCounter
unsigned int beginLumiOfFit
edm::TimeValue_t beginTimeOfFit
Timestamp const & beginTime() const
LuminosityBlockNumber_t luminosityBlock() const
void reset(std::string ResetType)
unsigned int lastLumiOfFit
TimeValue_t value() const
Definition: Timestamp.h:56
void Vx3DHLTAnalyzer::bookHistograms ( DQMStore::IBooker ibooker,
edm::Run const &  iRun,
edm::EventSetup const &   
)
overrideprivatevirtual

Implements DQMEDAnalyzer.

Definition at line 1184 of file Vx3DHLTAnalyzer.cc.

References DQMStore::IBooker::book1D(), DQMStore::IBooker::book2D(), DQMStore::IBooker::bookFloat(), DEFINE_FWK_MODULE, MonitorElement::Fill(), MonitorElement::getTH1(), reset(), MonitorElement::setAxisTitle(), DQMStore::IBooker::setCurrentFolder(), and HiClusterCompatibility_cfi::zStep.

1185 {
1186  ibooker.setCurrentFolder("BeamPixel");
1187 
1188  Vx_X = ibooker.book1D("F - vertex x", "Primary Vertex X Distribution", int(rint(xRange/xStep)), -xRange/2., xRange/2.);
1189  Vx_Y = ibooker.book1D("F - vertex y", "Primary Vertex Y Distribution", int(rint(yRange/yStep)), -yRange/2., yRange/2.);
1190  Vx_Z = ibooker.book1D("F - vertex z", "Primary Vertex Z Distribution", int(rint(zRange/zStep)), -zRange/2., zRange/2.);
1191  Vx_X->setAxisTitle("Primary Vertices X [cm]",1);
1192  Vx_X->setAxisTitle("Entries [#]",2);
1193  Vx_Y->setAxisTitle("Primary Vertices Y [cm]",1);
1194  Vx_Y->setAxisTitle("Entries [#]",2);
1195  Vx_Z->setAxisTitle("Primary Vertices Z [cm]",1);
1196  Vx_Z->setAxisTitle("Entries [#]",2);
1197 
1198  Vx_X_Cum = ibooker.book1D("H - vertex x cum", "Primary Vertex X Distribution (Cumulative)", int(rint(xRange/xStep)), -xRange/2., xRange/2.);
1199  Vx_Y_Cum = ibooker.book1D("H - vertex y cum", "Primary Vertex Y Distribution (Cumulative)", int(rint(yRange/yStep)), -yRange/2., yRange/2.);
1200  Vx_Z_Cum = ibooker.book1D("H - vertex z cum", "Primary Vertex Z Distribution (Cumulative)", int(rint(zRange/zStep)), -zRange/2., zRange/2.);
1201  Vx_X_Cum->setAxisTitle("Primary Vertices X [cm]",1);
1202  Vx_X_Cum->setAxisTitle("Entries [#]",2);
1203  Vx_Y_Cum->setAxisTitle("Primary Vertices Y [cm]",1);
1204  Vx_Y_Cum->setAxisTitle("Entries [#]",2);
1205  Vx_Z_Cum->setAxisTitle("Primary Vertices Z [cm]",1);
1206  Vx_Z_Cum->setAxisTitle("Entries [#]",2);
1207 
1208  mXlumi = ibooker.book1D("B - muX vs lumi", "#mu_{x} vs. Lumisection", nLumiXaxisRange, 0.5, ((double)nLumiXaxisRange)+0.5);
1209  mYlumi = ibooker.book1D("B - muY vs lumi", "#mu_{y} vs. Lumisection", nLumiXaxisRange, 0.5, ((double)nLumiXaxisRange)+0.5);
1210  mZlumi = ibooker.book1D("B - muZ vs lumi", "#mu_{z} vs. Lumisection", nLumiXaxisRange, 0.5, ((double)nLumiXaxisRange)+0.5);
1211  mXlumi->setAxisTitle("Lumisection [#]",1);
1212  mXlumi->setAxisTitle("#mu_{x} [cm]",2);
1213  mXlumi->getTH1()->SetOption("E1");
1214  mYlumi->setAxisTitle("Lumisection [#]",1);
1215  mYlumi->setAxisTitle("#mu_{y} [cm]",2);
1216  mYlumi->getTH1()->SetOption("E1");
1217  mZlumi->setAxisTitle("Lumisection [#]",1);
1218  mZlumi->setAxisTitle("#mu_{z} [cm]",2);
1219  mZlumi->getTH1()->SetOption("E1");
1220 
1221  sXlumi = ibooker.book1D("C - sigmaX vs lumi", "#sigma_{x} vs. Lumisection", nLumiXaxisRange, 0.5, ((double)nLumiXaxisRange)+0.5);
1222  sYlumi = ibooker.book1D("C - sigmaY vs lumi", "#sigma_{y} vs. Lumisection", nLumiXaxisRange, 0.5, ((double)nLumiXaxisRange)+0.5);
1223  sZlumi = ibooker.book1D("C - sigmaZ vs lumi", "#sigma_{z} vs. Lumisection", nLumiXaxisRange, 0.5, ((double)nLumiXaxisRange)+0.5);
1224  sXlumi->setAxisTitle("Lumisection [#]",1);
1225  sXlumi->setAxisTitle("#sigma_{x} [cm]",2);
1226  sXlumi->getTH1()->SetOption("E1");
1227  sYlumi->setAxisTitle("Lumisection [#]",1);
1228  sYlumi->setAxisTitle("#sigma_{y} [cm]",2);
1229  sYlumi->getTH1()->SetOption("E1");
1230  sZlumi->setAxisTitle("Lumisection [#]",1);
1231  sZlumi->setAxisTitle("#sigma_{z} [cm]",2);
1232  sZlumi->getTH1()->SetOption("E1");
1233 
1234  dxdzlumi = ibooker.book1D("D - dxdz vs lumi", "dX/dZ vs. Lumisection", nLumiXaxisRange, 0.5, ((double)nLumiXaxisRange)+0.5);
1235  dydzlumi = ibooker.book1D("D - dydz vs lumi", "dY/dZ vs. Lumisection", nLumiXaxisRange, 0.5, ((double)nLumiXaxisRange)+0.5);
1236  dxdzlumi->setAxisTitle("Lumisection [#]",1);
1237  dxdzlumi->setAxisTitle("dX/dZ [rad]",2);
1238  dxdzlumi->getTH1()->SetOption("E1");
1239  dydzlumi->setAxisTitle("Lumisection [#]",1);
1240  dydzlumi->setAxisTitle("dY/dZ [rad]",2);
1241  dydzlumi->getTH1()->SetOption("E1");
1242 
1243  Vx_ZX = ibooker.book2D("E - vertex zx", "Primary Vertex ZX Distribution", int(rint(zRange/zStep)), -zRange/2., zRange/2., int(rint(xRange/xStep)), -xRange/2., xRange/2.);
1244  Vx_ZY = ibooker.book2D("E - vertex zy", "Primary Vertex ZY Distribution", int(rint(zRange/zStep)), -zRange/2., zRange/2., int(rint(yRange/yStep)), -yRange/2., yRange/2.);
1245  Vx_XY = ibooker.book2D("E - vertex xy", "Primary Vertex XY Distribution", int(rint(xRange/xStep)), -xRange/2., xRange/2., int(rint(yRange/yStep)), -yRange/2., yRange/2.);
1246  Vx_ZX->setAxisTitle("Primary Vertices Z [cm]",1);
1247  Vx_ZX->setAxisTitle("Primary Vertices X [cm]",2);
1248  Vx_ZX->setAxisTitle("Entries [#]",3);
1249  Vx_ZY->setAxisTitle("Primary Vertices Z [cm]",1);
1250  Vx_ZY->setAxisTitle("Primary Vertices Y [cm]",2);
1251  Vx_ZY->setAxisTitle("Entries [#]",3);
1252  Vx_XY->setAxisTitle("Primary Vertices X [cm]",1);
1253  Vx_XY->setAxisTitle("Primary Vertices Y [cm]",2);
1254  Vx_XY->setAxisTitle("Entries [#]",3);
1255 
1256  Vx_ZX_Cum = ibooker.book2D("G - vertex zx cum", "Primary Vertex ZX Distribution (Cumulative)", int(rint(zRange/zStep)), -zRange/2., zRange/2., int(rint(xRange/xStep)), -xRange/2., xRange/2.);
1257  Vx_ZY_Cum = ibooker.book2D("G - vertex zy cum", "Primary Vertex ZY Distribution (Cumulative)", int(rint(zRange/zStep)), -zRange/2., zRange/2., int(rint(yRange/yStep)), -yRange/2., yRange/2.);
1258  Vx_XY_Cum = ibooker.book2D("G - vertex xy cum", "Primary Vertex XY Distribution (Cumulative)", int(rint(xRange/xStep)), -xRange/2., xRange/2., int(rint(yRange/yStep)), -yRange/2., yRange/2.);
1259  Vx_ZX_Cum->setAxisTitle("Primary Vertices Z [cm]",1);
1260  Vx_ZX_Cum->setAxisTitle("Primary Vertices X [cm]",2);
1261  Vx_ZX_Cum->setAxisTitle("Entries [#]",3);
1262  Vx_ZY_Cum->setAxisTitle("Primary Vertices Z [cm]",1);
1263  Vx_ZY_Cum->setAxisTitle("Primary Vertices Y [cm]",2);
1264  Vx_ZY_Cum->setAxisTitle("Entries [#]",3);
1265  Vx_XY_Cum->setAxisTitle("Primary Vertices X [cm]",1);
1266  Vx_XY_Cum->setAxisTitle("Primary Vertices Y [cm]",2);
1267  Vx_XY_Cum->setAxisTitle("Entries [#]",3);
1268 
1269  hitCounter = ibooker.book1D("J - pixelHits vs lumi", "# Pixel-Hits vs. Lumisection", nLumiXaxisRange, 0.5, ((double)nLumiXaxisRange)+0.5);
1270  hitCounter->setAxisTitle("Lumisection [#]",1);
1271  hitCounter->setAxisTitle("Pixel-Hits [#]",2);
1272  hitCounter->getTH1()->SetOption("E1");
1273 
1274  goodVxCounter = ibooker.book1D("I - good vertices vs lumi", "# Good vertices vs. Lumisection", nLumiXaxisRange, 0.5, ((double)nLumiXaxisRange)+0.5);
1275  goodVxCounter->setAxisTitle("Lumisection [#]",1);
1276  goodVxCounter->setAxisTitle("Good vertices [#]",2);
1277  goodVxCounter->getTH1()->SetOption("E1");
1278 
1279  statusCounter = ibooker.book1D("K - status vs lumi", "App. Status vs. Lumisection", nLumiXaxisRange, 0.5, ((double)nLumiXaxisRange)+0.5);
1280  statusCounter->setAxisTitle("Lumisection [#]",1);
1281  statusCounter->getTH1()->SetOption("E1");
1282  statusCounter->getTH1()->GetYaxis()->Set(11,-5.5,5.5);
1283  statusCounter->getTH1()->GetYaxis()->SetBinLabel(1, "Max Lumi.");
1284  statusCounter->getTH1()->GetYaxis()->SetBinLabel(2, "Neg. det.");
1285  statusCounter->getTH1()->GetYaxis()->SetBinLabel(3, "Infinite err.");
1286  statusCounter->getTH1()->GetYaxis()->SetBinLabel(4, "No vtx.");
1287  statusCounter->getTH1()->GetYaxis()->SetBinLabel(5, "Infinite EDM");
1288  statusCounter->getTH1()->GetYaxis()->SetBinLabel(6, "OK");
1289  statusCounter->getTH1()->GetYaxis()->SetBinLabel(7, "MINUIT stat.");
1290  statusCounter->getTH1()->GetYaxis()->SetBinLabel(8, "MINUIT stat.");
1291  statusCounter->getTH1()->GetYaxis()->SetBinLabel(9, "MINUIT stat.");
1292  statusCounter->getTH1()->GetYaxis()->SetBinLabel(10, "MINUIT stat.");
1293  statusCounter->getTH1()->GetYaxis()->SetBinLabel(11, "MINUIT stat.");
1294 
1295  fitResults = ibooker.book2D("A - fit results","Results of Beam Spot Fit", 2, 0., 2., 9, 0., 9.);
1296  fitResults->setAxisTitle("Ongoing: bootstrapping", 1);
1297  fitResults->setBinLabel(9, "X[cm]", 2);
1298  fitResults->setBinLabel(8, "Y[cm]", 2);
1299  fitResults->setBinLabel(7, "Z[cm]", 2);
1300  fitResults->setBinLabel(6, "#sigma_{X}[cm]", 2);
1301  fitResults->setBinLabel(5, "#sigma_{Y}[cm]", 2);
1302  fitResults->setBinLabel(4, "#sigma_{Z}[cm]", 2);
1303  fitResults->setBinLabel(3, "#frac{dX}{dZ}[rad]", 2);
1304  fitResults->setBinLabel(2, "#frac{dY}{dZ}[rad]", 2);
1305  fitResults->setBinLabel(1, "Vtx[#]", 2);
1306  fitResults->setBinLabel(1, "Value", 1);
1307  fitResults->setBinLabel(2, "Error (stat)", 1);
1308  fitResults->getTH1()->SetOption("text");
1309 
1310 
1311  ibooker.setCurrentFolder("BeamPixel/EventInfo");
1312 
1313  reportSummary = ibooker.bookFloat("reportSummary");
1314  reportSummary->Fill(-1);
1315  reportSummaryMap = ibooker.book2D("reportSummaryMap","Pixel-Vertices Beam Spot: % Good Fits", 1, 0., 1., 1, 0., 1.);
1316  reportSummaryMap->getTH1()->SetBinContent(1, 1, -1);
1317 
1318  ibooker.setCurrentFolder("BeamPixel/EventInfo/reportSummaryContents");
1319 
1320  // Convention for reportSummary and reportSummaryMap:
1321  // - -1% at the moment of creation of the histogram (i.e. white histogram)
1322  // - n% numberGoodFits / numberFits
1323 
1324 
1325  reset("scratch"); // Initialize histograms after creation
1326 }
MonitorElement * statusCounter
MonitorElement * dxdzlumi
MonitorElement * Vx_ZX
MonitorElement * Vx_Y_Cum
unsigned int nLumiXaxisRange
MonitorElement * Vx_X
void setBinLabel(int bin, const std::string &label, int axis=1)
set bin label for x, y or z axis (axis=1, 2, 3 respectively)
MonitorElement * mYlumi
MonitorElement * sYlumi
MonitorElement * reportSummaryMap
void Fill(long long x)
MonitorElement * Vx_XY
MonitorElement * sZlumi
MonitorElement * fitResults
MonitorElement * Vx_ZY
MonitorElement * reportSummary
MonitorElement * Vx_ZY_Cum
MonitorElement * goodVxCounter
MonitorElement * book1D(Args &&...args)
Definition: DQMStore.h:115
MonitorElement * dydzlumi
TH1 * getTH1(void) const
MonitorElement * Vx_ZX_Cum
MonitorElement * Vx_Z
MonitorElement * mXlumi
void reset(std::string ResetType)
MonitorElement * Vx_X_Cum
MonitorElement * mZlumi
MonitorElement * sXlumi
void setCurrentFolder(const std::string &fullpath)
Definition: DQMStore.cc:277
MonitorElement * book2D(Args &&...args)
Definition: DQMStore.h:133
MonitorElement * Vx_XY_Cum
MonitorElement * Vx_Z_Cum
MonitorElement * bookFloat(Args &&...args)
Definition: DQMStore.h:109
MonitorElement * hitCounter
void setAxisTitle(const std::string &title, int axis=1)
set x-, y- or z-axis title (axis=1, 2, 3 respectively)
MonitorElement * Vx_Y
void Vx3DHLTAnalyzer::endLuminosityBlock ( const edm::LuminosityBlock lumiBlock,
const edm::EventSetup iSetup 
)
overrideprivate

Definition at line 904 of file Vx3DHLTAnalyzer.cc.

References gather_cfg::cout, MillePedeFileConverter_cfg::e, edm::LuminosityBlockBase::endTime(), edm::service::formatTime(), mps_fire::i, edm::LuminosityBlockBase::luminosityBlock(), funct::pow(), reset(), convertSQLiteXML::runNumber, mathSSE::sqrt(), create_public_pileup_plots::vals, and edm::Timestamp::value().

905 {
906  stringstream histTitle;
907  int goodData;
908 
909  if ((nLumiFit != 0) && (lumiCounter%nLumiFit == 0) && (beginTimeOfFit != 0) && (runNumber != 0))
910  {
911  endTimeOfFit = lumiBlock.endTime().value();
912  endLumiOfFit = lumiBlock.luminosityBlock();
914  vector<double> vals;
915 
916  hitCounter->getTH1()->SetBinContent(lastLumiOfFit, (double)totalHits);
917  hitCounter->getTH1()->SetBinError(lastLumiOfFit, (totalHits != 0 ? 1. : 0.)); // It's not sqrt(n) because we want to weight all entries in the same way for the fit
918 
919  if (dataFromFit == true)
920  {
921  vector<double> fitResults;
922 
923  fitResults.push_back(Vx_X->getTH1()->GetRMS()*Vx_X->getTH1()->GetRMS());
924  fitResults.push_back(Vx_Y->getTH1()->GetRMS()*Vx_Y->getTH1()->GetRMS());
925  fitResults.push_back(Vx_Z->getTH1()->GetRMS()*Vx_Z->getTH1()->GetRMS());
926  fitResults.push_back(0.0);
927  fitResults.push_back(0.0);
928  fitResults.push_back(0.0);
929  fitResults.push_back(Vx_X->getTH1()->GetMean());
930  fitResults.push_back(Vx_Y->getTH1()->GetMean());
931  fitResults.push_back(Vx_Z->getTH1()->GetMean());
932  for (unsigned int i = 0; i < nParams; i++) fitResults.push_back(0.0);
933 
934  if (internalDebug == true)
935  {
936  cout << "[Vx3DHLTAnalyzer]::\t@@@ Beam Spot parameters - prefit @@@" << endl;
937 
938  printFitParams(fitResults);
939 
940  cout << "Runnumber " << runNumber << endl;
941  cout << "BeginTimeOfFit " << formatTime(beginTimeOfFit >> 32) << " " << (beginTimeOfFit >> 32) << endl;
942  cout << "EndTimeOfFit " << formatTime(endTimeOfFit >> 32) << " " << (endTimeOfFit >> 32) << endl;
943  cout << "LumiRange " << beginLumiOfFit << " - " << endLumiOfFit << endl;
944  }
945 
946  goodData = MyFit(&fitResults);
947 
948  if (internalDebug == true)
949  {
950  cout << "[Vx3DHLTAnalyzer]::\t@@@ Beam Spot parameters - postfit @@@" << endl;
951 
952  printFitParams(fitResults);
953 
954  cout << "goodData --> " << goodData << endl;
955  cout << "Used vertices --> " << counterVx << endl;
956  }
957 
958  if (goodData == 0)
959  {
960  vals.push_back(fitResults[6]);
961  vals.push_back(fitResults[7]);
962  vals.push_back(fitResults[8]);
963  vals.push_back(std::sqrt(std::fabs(fitResults[0])));
964  vals.push_back(std::sqrt(std::fabs(fitResults[1])));
965  vals.push_back(std::sqrt(std::fabs(fitResults[2])));
966  vals.push_back(fitResults[5]);
967  vals.push_back(fitResults[4]);
968 
969  vals.push_back(std::pow(fitResults[6+nParams],2.));
970  vals.push_back(std::pow(fitResults[7+nParams],2.));
971  vals.push_back(std::pow(fitResults[8+nParams],2.));
972  vals.push_back(std::pow(std::fabs(fitResults[0+nParams]) / (2.*std::sqrt(std::fabs(fitResults[0]))),2.));
973  vals.push_back(std::pow(std::fabs(fitResults[1+nParams]) / (2.*std::sqrt(std::fabs(fitResults[1]))),2.));
974  vals.push_back(std::pow(std::fabs(fitResults[2+nParams]) / (2.*std::sqrt(std::fabs(fitResults[2]))),2.));
975  vals.push_back(std::pow(fitResults[5+nParams],2.));
976  vals.push_back(std::pow(fitResults[4+nParams],2.));
977  }
978  else for (unsigned int i = 0; i < (nParams-1)*2; i++) vals.push_back(0.0);
979 
980  fitResults.clear();
981  }
982  else
983  {
984  counterVx = Vx_X->getTH1F()->GetEntries();
985 
986  if (Vx_X->getTH1F()->GetEntries() >= minNentries)
987  {
988  goodData = 0;
989 
990  vals.push_back(Vx_X->getTH1F()->GetMean());
991  vals.push_back(Vx_Y->getTH1F()->GetMean());
992  vals.push_back(Vx_Z->getTH1F()->GetMean());
993  vals.push_back(Vx_X->getTH1F()->GetRMS());
994  vals.push_back(Vx_Y->getTH1F()->GetRMS());
995  vals.push_back(Vx_Z->getTH1F()->GetRMS());
996  vals.push_back(0.0);
997  vals.push_back(0.0);
998 
999  vals.push_back(std::pow(Vx_X->getTH1F()->GetMeanError(),2.));
1000  vals.push_back(std::pow(Vx_Y->getTH1F()->GetMeanError(),2.));
1001  vals.push_back(std::pow(Vx_Z->getTH1F()->GetMeanError(),2.));
1002  vals.push_back(std::pow(Vx_X->getTH1F()->GetRMSError(),2.));
1003  vals.push_back(std::pow(Vx_Y->getTH1F()->GetRMSError(),2.));
1004  vals.push_back(std::pow(Vx_Z->getTH1F()->GetRMSError(),2.));
1005  vals.push_back(0.0);
1006  vals.push_back(0.0);
1007  }
1008  else
1009  {
1010  goodData = -2;
1011  for (unsigned int i = 0; i < (nParams-1)*2; i++) vals.push_back(0.0);
1012  }
1013  }
1014 
1015  // vals[0] = X0
1016  // vals[1] = Y0
1017  // vals[2] = Z0
1018  // vals[3] = sigmaX0
1019  // vals[4] = sigmaY0
1020  // vals[5] = sigmaZ0
1021  // vals[6] = dxdz
1022  // vals[7] = dydz
1023 
1024  // vals[8] = err^2 X0
1025  // vals[9] = err^2 Y0
1026  // vals[10] = err^2 Z0
1027  // vals[11] = err^2 sigmaX0
1028  // vals[12] = err^2 sigmaY0
1029  // vals[13] = err^2 sigmaZ0
1030  // vals[14] = err^2 dxdz
1031  // vals[15] = err^2 dydz
1032 
1033  numberFits++;
1035  if (internalDebug == true) cout << "[Vx3DHLTAnalyzer]::\tUsed vertices: " << counterVx << endl;
1036 
1037  statusCounter->getTH1()->SetBinContent(lastLumiOfFit, (double)goodData);
1038  statusCounter->getTH1()->SetBinError(lastLumiOfFit, 1e-3);
1039 
1040  if (goodData == 0)
1041  {
1042  numberGoodFits++;
1043 
1044  histTitle << "Ongoing: fitted lumis " << beginLumiOfFit << " - " << endLumiOfFit;
1045  reset("whole");
1046  }
1047  else
1048  {
1049  if (goodData == -2) histTitle << "Ongoing: not enough evts (" << lumiCounter << " - " << maxLumiIntegration << " lumis)";
1050  else histTitle << "Ongoing: temporary problems (" << lumiCounter << " - " << maxLumiIntegration << " lumis)";
1051 
1052  if (lumiCounter >= maxLumiIntegration)
1053  {
1054  statusCounter->getTH1()->SetBinContent(lastLumiOfFit, -5);
1055  statusCounter->getTH1()->SetBinError(lastLumiOfFit, 1e-3);
1056  reset("whole");
1057  }
1058  else reset("hitCounter");
1059  }
1060 
1061  reportSummary->Fill((numberFits != 0 ? ((double)numberGoodFits) / ((double)numberFits) : -1));
1062  reportSummaryMap->getTH1()->SetBinContent(1, 1, (numberFits != 0 ? ((double)numberGoodFits) / ((double)numberFits) : -1));
1063 
1064  fitResults->setAxisTitle(histTitle.str().c_str(), 1);
1065 
1066  fitResults->setBinContent(1, 9, vals[0]);
1067  fitResults->setBinContent(1, 8, vals[1]);
1068  fitResults->setBinContent(1, 7, vals[2]);
1069  fitResults->setBinContent(1, 6, vals[3]);
1070  fitResults->setBinContent(1, 5, vals[4]);
1071  fitResults->setBinContent(1, 4, vals[5]);
1072  fitResults->setBinContent(1, 3, vals[6]);
1073  fitResults->setBinContent(1, 2, vals[7]);
1074  fitResults->setBinContent(1, 1, counterVx);
1075 
1076  fitResults->setBinContent(2, 9, std::sqrt(vals[8]));
1077  fitResults->setBinContent(2, 8, std::sqrt(vals[9]));
1078  fitResults->setBinContent(2, 7, std::sqrt(vals[10]));
1079  fitResults->setBinContent(2, 6, std::sqrt(vals[11]));
1080  fitResults->setBinContent(2, 5, std::sqrt(vals[12]));
1081  fitResults->setBinContent(2, 4, std::sqrt(vals[13]));
1082  fitResults->setBinContent(2, 3, std::sqrt(vals[14]));
1083  fitResults->setBinContent(2, 2, std::sqrt(vals[15]));
1084  fitResults->setBinContent(2, 1, std::sqrt(counterVx));
1085 
1086  // Linear fit to the historical plots
1087  TF1* myLinFit = new TF1("myLinFit", "[0] + [1]*x", mXlumi->getTH1()->GetXaxis()->GetXmin(), mXlumi->getTH1()->GetXaxis()->GetXmax());
1088  myLinFit->SetLineColor(2);
1089  myLinFit->SetLineWidth(2);
1090  myLinFit->SetParName(0,"Inter.");
1091  myLinFit->SetParName(1,"Slope");
1092 
1093  mXlumi->getTH1()->SetBinContent(lastLumiOfFit, vals[0]);
1094  mXlumi->getTH1()->SetBinError(lastLumiOfFit, std::sqrt(vals[8]));
1095  myLinFit->SetParameter(0, mXlumi->getTH1()->GetMean(2));
1096  myLinFit->SetParameter(1, 0.0);
1097  mXlumi->getTH1()->Fit(myLinFit,"QR");
1098 
1099  mYlumi->getTH1()->SetBinContent(lastLumiOfFit, vals[1]);
1100  mYlumi->getTH1()->SetBinError(lastLumiOfFit, std::sqrt(vals[9]));
1101  myLinFit->SetParameter(0, mYlumi->getTH1()->GetMean(2));
1102  myLinFit->SetParameter(1, 0.0);
1103  mYlumi->getTH1()->Fit(myLinFit,"QR");
1104 
1105  mZlumi->getTH1()->SetBinContent(lastLumiOfFit, vals[2]);
1106  mZlumi->getTH1()->SetBinError(lastLumiOfFit, std::sqrt(vals[10]));
1107  myLinFit->SetParameter(0, mZlumi->getTH1()->GetMean(2));
1108  myLinFit->SetParameter(1, 0.0);
1109  mZlumi->getTH1()->Fit(myLinFit,"QR");
1110 
1111  sXlumi->getTH1()->SetBinContent(lastLumiOfFit, vals[3]);
1112  sXlumi->getTH1()->SetBinError(lastLumiOfFit, std::sqrt(vals[11]));
1113  myLinFit->SetParameter(0, sXlumi->getTH1()->GetMean(2));
1114  myLinFit->SetParameter(1, 0.0);
1115  sXlumi->getTH1()->Fit(myLinFit,"QR");
1116 
1117  sYlumi->getTH1()->SetBinContent(lastLumiOfFit, vals[4]);
1118  sYlumi->getTH1()->SetBinError(lastLumiOfFit, std::sqrt(vals[12]));
1119  myLinFit->SetParameter(0, sYlumi->getTH1()->GetMean(2));
1120  myLinFit->SetParameter(1, 0.0);
1121  sYlumi->getTH1()->Fit(myLinFit,"QR");
1122 
1123  sZlumi->getTH1()->SetBinContent(lastLumiOfFit, vals[5]);
1124  sZlumi->getTH1()->SetBinError(lastLumiOfFit, std::sqrt(vals[13]));
1125  myLinFit->SetParameter(0, sZlumi->getTH1()->GetMean(2));
1126  myLinFit->SetParameter(1, 0.0);
1127  sZlumi->getTH1()->Fit(myLinFit,"QR");
1128 
1129  dxdzlumi->getTH1()->SetBinContent(lastLumiOfFit, vals[6]);
1130  dxdzlumi->getTH1()->SetBinError(lastLumiOfFit, std::sqrt(vals[14]));
1131  myLinFit->SetParameter(0, dxdzlumi->getTH1()->GetMean(2));
1132  myLinFit->SetParameter(1, 0.0);
1133  dxdzlumi->getTH1()->Fit(myLinFit,"QR");
1134 
1135  dydzlumi->getTH1()->SetBinContent(lastLumiOfFit, vals[7]);
1136  dydzlumi->getTH1()->SetBinError(lastLumiOfFit, std::sqrt(vals[15]));
1137  myLinFit->SetParameter(0, dydzlumi->getTH1()->GetMean(2));
1138  myLinFit->SetParameter(1, 0.0);
1139  dydzlumi->getTH1()->Fit(myLinFit,"QR");
1140 
1141  myLinFit->SetParameter(0, hitCounter->getTH1()->GetMean(2));
1142  myLinFit->SetParameter(1, 0.0);
1143  hitCounter->getTH1()->Fit(myLinFit,"QR");
1144 
1145  goodVxCounter->getTH1()->SetBinContent(lastLumiOfFit, (double)counterVx);
1146  goodVxCounter->getTH1()->SetBinError(lastLumiOfFit, (counterVx != 0 ? 1. : 0.)); // It's not sqrt(n) because we want to weight all entries in the same way for the fit
1147  myLinFit->SetParameter(0, goodVxCounter->getTH1()->GetMean(2));
1148  myLinFit->SetParameter(1, 0.0);
1149  goodVxCounter->getTH1()->Fit(myLinFit,"QR");
1150 
1151  delete myLinFit;
1152  vals.clear();
1153  }
1154  else if ((nLumiFit != 0) && (lumiCounter%nLumiFit != 0) && (beginTimeOfFit != 0) && (runNumber != 0))
1155  {
1156  histTitle << "Ongoing: accumulating evts (" << lumiCounter%nLumiFit << " - " << nLumiFit << " in " << lumiCounter << " - " << maxLumiIntegration << " lumis)";
1157  fitResults->setAxisTitle(histTitle.str().c_str(), 1);
1158  if ((debugMode == true) && (outputDebugFile.is_open() == true))
1159  {
1160  outputDebugFile << "\n" << "Runnumber " << runNumber << endl;
1161  outputDebugFile << "BeginTimeOfFit " << formatTime(beginTimeOfFit >> 32) << " " << (beginTimeOfFit >> 32) << endl;
1162  outputDebugFile << "BeginLumiRange " << beginLumiOfFit << endl;
1163  outputDebugFile << histTitle.str().c_str() << "\n" << endl;
1164  }
1165  }
1166  else if ((nLumiFit == 0) || (beginTimeOfFit == 0) || (runNumber == 0))
1167  {
1168  histTitle << "Ongoing: no ongoing fits";
1169  fitResults->setAxisTitle(histTitle.str().c_str(), 1);
1170  if ((debugMode == true) && (outputDebugFile.is_open() == true)) outputDebugFile << histTitle.str().c_str() << "\n" << endl;
1171 
1172  endLumiOfFit = lumiBlock.luminosityBlock();
1173 
1174  hitCounter->getTH1()->SetBinContent(endLumiOfFit, (double)totalHits);
1175  hitCounter->getTH1()->SetBinError(endLumiOfFit, std::sqrt((double)totalHits));
1176 
1177  reset("whole");
1178  }
1179 
1180  if (internalDebug == true) cout << "[Vx3DHLTAnalyzer]::\tHistogram title: " << histTitle.str() << endl;
1181 }
unsigned int lumiCounter
MonitorElement * statusCounter
MonitorElement * dxdzlumi
unsigned int totalHits
unsigned int maxLumiIntegration
unsigned int numberFits
unsigned int beginLumiOfFit
int MyFit(std::vector< double > *vals)
unsigned int minNentries
MonitorElement * Vx_X
MonitorElement * mYlumi
edm::TimeValue_t beginTimeOfFit
edm::TimeValue_t endTimeOfFit
MonitorElement * sYlumi
MonitorElement * reportSummaryMap
void writeToFile(std::vector< double > *vals, edm::TimeValue_t BeginTimeOfFit, edm::TimeValue_t EndTimeOfFit, unsigned int BeginLumiOfFit, unsigned int EndLumiOfFit, int dataType)
void Fill(long long x)
unsigned int nParams
MonitorElement * sZlumi
LuminosityBlockNumber_t luminosityBlock() const
MonitorElement * fitResults
unsigned int counterVx
std::string formatTime(const time_t &t)
unsigned int endLumiOfFit
unsigned int numberGoodFits
T sqrt(T t)
Definition: SSEVec.h:18
MonitorElement * reportSummary
Timestamp const & endTime() const
MonitorElement * goodVxCounter
std::ofstream outputDebugFile
MonitorElement * dydzlumi
TH1 * getTH1(void) const
MonitorElement * Vx_Z
MonitorElement * mXlumi
void reset(std::string ResetType)
MonitorElement * mZlumi
MonitorElement * sXlumi
unsigned int lastLumiOfFit
TH1F * getTH1F(void) const
void printFitParams(const std::vector< double > &fitResults)
unsigned int runNumber
unsigned int nLumiFit
MonitorElement * hitCounter
TimeValue_t value() const
Definition: Timestamp.h:56
Power< A, B >::type pow(const A &a, const B &b)
Definition: Power.h:40
MonitorElement * Vx_Y
string Vx3DHLTAnalyzer::formatTime ( const time_t &  t)
private

Definition at line 210 of file Vx3DHLTAnalyzer.cc.

211 {
212  char ts[25];
213  strftime(ts, sizeof(ts), "%Y.%m.%d %H:%M:%S %Z", gmtime(&t));
214 
215  string ts_string(ts);
216 
217  return ts_string;
218 }
double Vx3DHLTAnalyzer::Gauss3DFunc ( const double *  par)
protected

Definition at line 221 of file Vx3DHLTAnalyzer.cc.

References DIM, mps_fire::i, cmsBatch::log, pi, mathSSE::sqrt(), fftjetpfpileupcleaner_cfi::Vertices, and x().

Referenced by MyFit().

222 {
223  double K[DIM][DIM]; // Covariance Matrix
224  double M[DIM][DIM]; // K^-1
225  double det;
226  double sumlog = 0.;
227 
228 // par[0] = K(0,0) --> Var[X]
229 // par[1] = K(1,1) --> Var[Y]
230 // par[2] = K(2,2) --> Var[Z]
231 // par[3] = K(0,1) = K(1,0) --> Cov[X,Y]
232 // par[4] = K(1,2) = K(2,1) --> Cov[Y,Z] --> dy/dz
233 // par[5] = K(0,2) = K(2,0) --> Cov[X,Z] --> dx/dz
234 // par[6] = mean x
235 // par[7] = mean y
236 // par[8] = mean z
237 
238  counterVx = 0;
239  for (unsigned int i = 0; i < Vertices.size(); i++)
240  {
242  (std::fabs(Vertices[i].z-zPos) <= maxLongLength))
243  {
244  if (considerVxCovariance == true)
245  {
246  K[0][0] = std::fabs(par[0]) + VxErrCorr*VxErrCorr * std::fabs(Vertices[i].Covariance[0][0]);
247  K[1][1] = std::fabs(par[1]) + VxErrCorr*VxErrCorr * std::fabs(Vertices[i].Covariance[1][1]);
248  K[2][2] = std::fabs(par[2]) + VxErrCorr*VxErrCorr * std::fabs(Vertices[i].Covariance[2][2]);
249  K[0][1] = K[1][0] = par[3] + VxErrCorr*VxErrCorr * Vertices[i].Covariance[0][1];
250  K[1][2] = K[2][1] = par[4]*(std::fabs(par[2])-std::fabs(par[1])) - par[5]*par[3] + VxErrCorr*VxErrCorr * Vertices[i].Covariance[1][2];
251  K[0][2] = K[2][0] = par[5]*(std::fabs(par[2])-std::fabs(par[0])) - par[4]*par[3] + VxErrCorr*VxErrCorr * Vertices[i].Covariance[0][2];
252  }
253  else
254  {
255  K[0][0] = std::fabs(par[0]);
256  K[1][1] = std::fabs(par[1]);
257  K[2][2] = std::fabs(par[2]);
258  K[0][1] = K[1][0] = par[3];
259  K[1][2] = K[2][1] = par[4]*(std::fabs(par[2])-std::fabs(par[1])) - par[5]*par[3];
260  K[0][2] = K[2][0] = par[5]*(std::fabs(par[2])-std::fabs(par[0])) - par[4]*par[3];
261  }
262 
263  det = K[0][0]*(K[1][1]*K[2][2] - K[1][2]*K[1][2]) -
264  K[0][1]*(K[0][1]*K[2][2] - K[0][2]*K[1][2]) +
265  K[0][2]*(K[0][1]*K[1][2] - K[0][2]*K[1][1]);
266 
267  M[0][0] = (K[1][1]*K[2][2] - K[1][2]*K[1][2]) / det;
268  M[1][1] = (K[0][0]*K[2][2] - K[0][2]*K[0][2]) / det;
269  M[2][2] = (K[0][0]*K[1][1] - K[0][1]*K[0][1]) / det;
270  M[0][1] = M[1][0] = (K[0][2]*K[1][2] - K[0][1]*K[2][2]) / det;
271  M[1][2] = M[2][1] = (K[0][2]*K[0][1] - K[1][2]*K[0][0]) / det;
272  M[0][2] = M[2][0] = (K[0][1]*K[1][2] - K[0][2]*K[1][1]) / det;
273 
274  sumlog += double(DIM)*std::log(2.*pi) + std::log(std::fabs(det)) +
275  (M[0][0]*(Vertices[i].x-par[6])*(Vertices[i].x-par[6]) +
276  M[1][1]*(Vertices[i].y-par[7])*(Vertices[i].y-par[7]) +
277  M[2][2]*(Vertices[i].z-par[8])*(Vertices[i].z-par[8]) +
278  2.*M[0][1]*(Vertices[i].x-par[6])*(Vertices[i].y-par[7]) +
279  2.*M[1][2]*(Vertices[i].y-par[7])*(Vertices[i].z-par[8]) +
280  2.*M[0][2]*(Vertices[i].x-par[6])*(Vertices[i].z-par[8]));
281 
282  counterVx++;
283  }
284  }
285 
286  return sumlog;
287 }
unsigned int counterVx
T sqrt(T t)
Definition: SSEVec.h:18
std::vector< VertexType > Vertices
#define DIM
unsigned int Vx3DHLTAnalyzer::HitCounter ( const edm::Event iEvent)
private

Definition at line 196 of file Vx3DHLTAnalyzer.cc.

References edmNew::DetSetVector< T >::begin(), counter, edmNew::DetSetVector< T >::end(), and edm::Event::getByToken().

197 {
198  Handle<SiPixelRecHitCollection> rechitspixel;
199  iEvent.getByToken(pixelHitCollection, rechitspixel);
200 
201  unsigned int counter = 0;
202 
203  for (SiPixelRecHitCollection::const_iterator j = rechitspixel->begin(); j != rechitspixel->end(); j++)
204  for (edmNew::DetSet<SiPixelRecHit>::const_iterator h = j->begin(); h != j->end(); h++) counter += h->cluster()->size();
205 
206  return counter;
207 }
boost::transform_iterator< IterHelp, const_IdIter > const_iterator
const_iterator end(bool update=false) const
bool getByToken(EDGetToken token, Handle< PROD > &result) const
Definition: Event.h:460
edm::EDGetTokenT< SiPixelRecHitCollection > pixelHitCollection
data_type const * const_iterator
Definition: DetSetNew.h:30
static std::atomic< unsigned int > counter
const_iterator begin(bool update=false) const
int Vx3DHLTAnalyzer::MyFit ( std::vector< double > *  vals)
private

Definition at line 290 of file Vx3DHLTAnalyzer.cc.

References gather_cfg::cout, MillePedeFileConverter_cfg::e, Gauss3DFunc(), mps_fire::i, edm::isNotFinite(), hiDetachedQuadStep_cff::nSigmaZ, NULL, and mathSSE::sqrt().

291 {
292  // ############################################
293  // # RETURN CODE: #
294  // # >0 == NO OK - fit status (MINUIT manual) #
295  // # 0 == OK #
296  // # -1 == NO OK - not finite edm #
297  // # -2 == NO OK - not enough "minNentries" #
298  // # -3 == NO OK - not finite errors #
299  // # -4 == NO OK - negative determinant #
300  // # -5 == NO OK - maxLumiIntegration reached #
301  // ############################################
302 
303  if ((vals != NULL) && (vals->size() == nParams*2))
304  {
305  double nSigmaXY = 10.;
306  double nSigmaZ = 10.;
307  double parDistanceXY = 1e-3; // Unit: [cm]
308  double parDistanceZ = 1e-2; // Unit: [cm]
309  double parDistanceddZ = 1e-3; // Unit: [rad]
310  double parDistanceCxy = 1e-5; // Unit: [cm^2]
311  double bestEdm;
312 
313  const unsigned int trials = 4;
314  double largerDist[trials] = {0.1, 5., 10., 100.};
315 
316  double covxz,covyz,det;
317  double deltaMean;
318  int bestMovementX = 1;
319  int bestMovementY = 1;
320  int bestMovementZ = 1;
321  int goodData;
322 
323  double edm;
324 
325  vector<double>::const_iterator it = vals->begin();
326 
327  ROOT::Math::Minimizer* Gauss3D = ROOT::Math::Factory::CreateMinimizer("Minuit2","Migrad");
328  Gauss3D->SetErrorDef(1.0);
329  if (internalDebug == true) Gauss3D->SetPrintLevel(3);
330  else Gauss3D->SetPrintLevel(0);
331 
332  ROOT::Math::Functor _Gauss3DFunc(this, &Vx3DHLTAnalyzer::Gauss3DFunc, nParams);
333  Gauss3D->SetFunction(_Gauss3DFunc);
334 
335  if (internalDebug == true) cout << "[Vx3DHLTAnalyzer]::\t@@@ START FITTING @@@" << endl;
336 
337  // @@@ Fit at X-deltaMean | X | X+deltaMean @@@
338  bestEdm = 1.;
339  for (int i = 0; i < 3; i++)
340  {
341  deltaMean = (double(i)-1.)*std::sqrt(*(it+0));
342  if (internalDebug == true) cout << "[Vx3DHLTAnalyzer]::\tdeltaMean --> " << deltaMean << endl;
343 
344  Gauss3D->Clear();
345 
346  Gauss3D->SetVariable(0,"var x ", *(it+0), parDistanceXY * parDistanceXY);
347  Gauss3D->SetVariable(1,"var y ", *(it+1), parDistanceXY * parDistanceXY);
348  Gauss3D->SetVariable(2,"var z ", *(it+2), parDistanceZ * parDistanceZ);
349  Gauss3D->SetVariable(3,"cov xy", *(it+3), parDistanceCxy);
350  Gauss3D->SetVariable(4,"dydz ", *(it+4), parDistanceddZ);
351  Gauss3D->SetVariable(5,"dxdz ", *(it+5), parDistanceddZ);
352  Gauss3D->SetVariable(6,"mean x", *(it+6)+deltaMean, parDistanceXY);
353  Gauss3D->SetVariable(7,"mean y", *(it+7), parDistanceXY);
354  Gauss3D->SetVariable(8,"mean z", *(it+8), parDistanceZ);
355 
356  // Set the central positions of the centroid for vertex rejection
357  xPos = Gauss3D->X()[6];
358  yPos = Gauss3D->X()[7];
359  zPos = Gauss3D->X()[8];
360 
361  // Set dimensions of the centroid for vertex rejection
362  maxTransRadius = nSigmaXY * std::sqrt(std::fabs(Gauss3D->X()[0]) + std::fabs(Gauss3D->X()[1])) / 2.;
363  maxLongLength = nSigmaZ * std::sqrt(std::fabs(Gauss3D->X()[2]));
364 
365  Gauss3D->Minimize();
366  goodData = Gauss3D->Status();
367  edm = Gauss3D->Edm();
368 
369  if (counterVx < minNentries) goodData = -2;
370  else if (isNotFinite(edm) == true) { goodData = -1; if (internalDebug == true) cout << "[Vx3DHLTAnalyzer]::\tNot finite edm !" << endl; }
371  else for (unsigned int j = 0; j < nParams; j++)
372  if (isNotFinite(Gauss3D->Errors()[j]) == true)
373  {
374  goodData = -3;
375  if (internalDebug == true) cout << "[Vx3DHLTAnalyzer]::\tNot finite errors !" << endl;
376  break;
377  }
378  if (goodData == 0)
379  {
380  covyz = Gauss3D->X()[4]*(std::fabs(Gauss3D->X()[2])-std::fabs(Gauss3D->X()[1])) - Gauss3D->X()[5]*Gauss3D->X()[3];
381  covxz = Gauss3D->X()[5]*(std::fabs(Gauss3D->X()[2])-std::fabs(Gauss3D->X()[0])) - Gauss3D->X()[4]*Gauss3D->X()[3];
382 
383  det = std::fabs(Gauss3D->X()[0]) * (std::fabs(Gauss3D->X()[1])*std::fabs(Gauss3D->X()[2]) - covyz*covyz) -
384  Gauss3D->X()[3] * (Gauss3D->X()[3]*std::fabs(Gauss3D->X()[2]) - covxz*covyz) +
385  covxz * (Gauss3D->X()[3]*covyz - covxz*std::fabs(Gauss3D->X()[1]));
386  if (det < 0.) { goodData = -4; if (internalDebug == true) cout << "[Vx3DHLTAnalyzer]::\tNegative determinant !" << endl; }
387  }
388 
389  if ((goodData == 0) && (std::fabs(edm) < bestEdm)) { bestEdm = edm; bestMovementX = i; }
390  }
391  if (internalDebug == true) cout << "[Vx3DHLTAnalyzer]::\tFound bestMovementX --> " << bestMovementX << endl;
392 
393  // @@@ Fit at Y-deltaMean | Y | Y+deltaMean @@@
394  bestEdm = 1.;
395  for (int i = 0; i < 3; i++)
396  {
397  deltaMean = (double(i)-1.)*std::sqrt(*(it+1));
398  if (internalDebug == true)
399  {
400  cout << "[Vx3DHLTAnalyzer]::\tdeltaMean --> " << deltaMean << endl;
401  cout << "[Vx3DHLTAnalyzer]::\tdeltaMean X --> " << (double(bestMovementX)-1.)*std::sqrt(*(it+0)) << endl;
402  }
403 
404  Gauss3D->Clear();
405 
406  Gauss3D->SetVariable(0,"var x ", *(it+0), parDistanceXY * parDistanceXY);
407  Gauss3D->SetVariable(1,"var y ", *(it+1), parDistanceXY * parDistanceXY);
408  Gauss3D->SetVariable(2,"var z ", *(it+2), parDistanceZ * parDistanceZ);
409  Gauss3D->SetVariable(3,"cov xy", *(it+3), parDistanceCxy);
410  Gauss3D->SetVariable(4,"dydz ", *(it+4), parDistanceddZ);
411  Gauss3D->SetVariable(5,"dxdz ", *(it+5), parDistanceddZ);
412  Gauss3D->SetVariable(6,"mean x", *(it+6)+(double(bestMovementX)-1.)*std::sqrt(*(it+0)), parDistanceXY);
413  Gauss3D->SetVariable(7,"mean y", *(it+7)+deltaMean, parDistanceXY);
414  Gauss3D->SetVariable(8,"mean z", *(it+8), parDistanceZ);
415 
416  // Set the central positions of the centroid for vertex rejection
417  xPos = Gauss3D->X()[6];
418  yPos = Gauss3D->X()[7];
419  zPos = Gauss3D->X()[8];
420 
421  // Set dimensions of the centroid for vertex rejection
422  maxTransRadius = nSigmaXY * std::sqrt(std::fabs(Gauss3D->X()[0]) + std::fabs(Gauss3D->X()[1])) / 2.;
423  maxLongLength = nSigmaZ * std::sqrt(std::fabs(Gauss3D->X()[2]));
424 
425  Gauss3D->Minimize();
426  goodData = Gauss3D->Status();
427  edm = Gauss3D->Edm();
428 
429  if (counterVx < minNentries) goodData = -2;
430  else if (isNotFinite(edm) == true) { goodData = -1; if (internalDebug == true) cout << "[Vx3DHLTAnalyzer]::\tNot finite edm !" << endl; }
431  else for (unsigned int j = 0; j < nParams; j++)
432  if (isNotFinite(Gauss3D->Errors()[j]) == true)
433  {
434  goodData = -3;
435  if (internalDebug == true) cout << "[Vx3DHLTAnalyzer]::\tNot finite errors !" << endl;
436  break;
437  }
438  if (goodData == 0)
439  {
440  covyz = Gauss3D->X()[4]*(std::fabs(Gauss3D->X()[2])-std::fabs(Gauss3D->X()[1])) - Gauss3D->X()[5]*Gauss3D->X()[3];
441  covxz = Gauss3D->X()[5]*(std::fabs(Gauss3D->X()[2])-std::fabs(Gauss3D->X()[0])) - Gauss3D->X()[4]*Gauss3D->X()[3];
442 
443  det = std::fabs(Gauss3D->X()[0]) * (std::fabs(Gauss3D->X()[1])*std::fabs(Gauss3D->X()[2]) - covyz*covyz) -
444  Gauss3D->X()[3] * (Gauss3D->X()[3]*std::fabs(Gauss3D->X()[2]) - covxz*covyz) +
445  covxz * (Gauss3D->X()[3]*covyz - covxz*std::fabs(Gauss3D->X()[1]));
446  if (det < 0.) { goodData = -4; if (internalDebug == true) cout << "[Vx3DHLTAnalyzer]::\tNegative determinant !" << endl; }
447  }
448 
449  if ((goodData == 0) && (std::fabs(edm) < bestEdm)) { bestEdm = edm; bestMovementY = i; }
450  }
451  if (internalDebug == true) cout << "[Vx3DHLTAnalyzer]::\tFound bestMovementY --> " << bestMovementY << endl;
452 
453  // @@@ Fit at Z-deltaMean | Z | Z+deltaMean @@@
454  bestEdm = 1.;
455  for (int i = 0; i < 3; i++)
456  {
457  deltaMean = (double(i)-1.)*std::sqrt(*(it+2));
458  if (internalDebug == true)
459  {
460  cout << "[Vx3DHLTAnalyzer]::\tdeltaMean --> " << deltaMean << endl;
461  cout << "[Vx3DHLTAnalyzer]::\tdeltaMean X --> " << (double(bestMovementX)-1.)*std::sqrt(*(it+0)) << endl;
462  cout << "[Vx3DHLTAnalyzer]::\tdeltaMean Y --> " << (double(bestMovementY)-1.)*std::sqrt(*(it+1)) << endl;
463  }
464 
465  Gauss3D->Clear();
466 
467  Gauss3D->SetVariable(0,"var x ", *(it+0), parDistanceXY * parDistanceXY);
468  Gauss3D->SetVariable(1,"var y ", *(it+1), parDistanceXY * parDistanceXY);
469  Gauss3D->SetVariable(2,"var z ", *(it+2), parDistanceZ * parDistanceZ);
470  Gauss3D->SetVariable(3,"cov xy", *(it+3), parDistanceCxy);
471  Gauss3D->SetVariable(4,"dydz ", *(it+4), parDistanceddZ);
472  Gauss3D->SetVariable(5,"dxdz ", *(it+5), parDistanceddZ);
473  Gauss3D->SetVariable(6,"mean x", *(it+6)+(double(bestMovementX)-1.)*std::sqrt(*(it+0)), parDistanceXY);
474  Gauss3D->SetVariable(7,"mean y", *(it+7)+(double(bestMovementY)-1.)*std::sqrt(*(it+1)), parDistanceXY);
475  Gauss3D->SetVariable(8,"mean z", *(it+8)+deltaMean, parDistanceZ);
476 
477  // Set the central positions of the centroid for vertex rejection
478  xPos = Gauss3D->X()[6];
479  yPos = Gauss3D->X()[7];
480  zPos = Gauss3D->X()[8];
481 
482  // Set dimensions of the centroid for vertex rejection
483  maxTransRadius = nSigmaXY * std::sqrt(std::fabs(Gauss3D->X()[0]) + std::fabs(Gauss3D->X()[1])) / 2.;
484  maxLongLength = nSigmaZ * std::sqrt(std::fabs(Gauss3D->X()[2]));
485 
486  Gauss3D->Minimize();
487  goodData = Gauss3D->Status();
488  edm = Gauss3D->Edm();
489 
490  if (counterVx < minNentries) goodData = -2;
491  else if (isNotFinite(edm) == true) { goodData = -1; if (internalDebug == true) cout << "[Vx3DHLTAnalyzer]::\tNot finite edm !" << endl; }
492  else for (unsigned int j = 0; j < nParams; j++)
493  if (isNotFinite(Gauss3D->Errors()[j]) == true)
494  {
495  goodData = -3;
496  if (internalDebug == true) cout << "[Vx3DHLTAnalyzer]::\tNot finite errors !" << endl;
497  break;
498  }
499  if (goodData == 0)
500  {
501  covyz = Gauss3D->X()[4]*(std::fabs(Gauss3D->X()[2])-std::fabs(Gauss3D->X()[1])) - Gauss3D->X()[5]*Gauss3D->X()[3];
502  covxz = Gauss3D->X()[5]*(std::fabs(Gauss3D->X()[2])-std::fabs(Gauss3D->X()[0])) - Gauss3D->X()[4]*Gauss3D->X()[3];
503 
504  det = std::fabs(Gauss3D->X()[0]) * (std::fabs(Gauss3D->X()[1])*std::fabs(Gauss3D->X()[2]) - covyz*covyz) -
505  Gauss3D->X()[3] * (Gauss3D->X()[3]*std::fabs(Gauss3D->X()[2]) - covxz*covyz) +
506  covxz * (Gauss3D->X()[3]*covyz - covxz*std::fabs(Gauss3D->X()[1]));
507  if (det < 0.) { goodData = -4; if (internalDebug == true) cout << "[Vx3DHLTAnalyzer]::\tNegative determinant !" << endl; }
508  }
509 
510  if ((goodData == 0) && (std::fabs(edm) < bestEdm)) { bestEdm = edm; bestMovementZ = i; }
511  }
512  if (internalDebug == true) cout << "[Vx3DHLTAnalyzer]::\tFound bestMovementZ --> " << bestMovementZ << endl;
513 
514  Gauss3D->Clear();
515 
516  // @@@ FINAL FIT @@@
517  Gauss3D->SetVariable(0,"var x ", *(it+0), parDistanceXY * parDistanceXY);
518  Gauss3D->SetVariable(1,"var y ", *(it+1), parDistanceXY * parDistanceXY);
519  Gauss3D->SetVariable(2,"var z ", *(it+2), parDistanceZ * parDistanceZ);
520  Gauss3D->SetVariable(3,"cov xy", *(it+3), parDistanceCxy);
521  Gauss3D->SetVariable(4,"dydz ", *(it+4), parDistanceddZ);
522  Gauss3D->SetVariable(5,"dxdz ", *(it+5), parDistanceddZ);
523  Gauss3D->SetVariable(6,"mean x", *(it+6)+(double(bestMovementX)-1.)*std::sqrt(*(it+0)), parDistanceXY);
524  Gauss3D->SetVariable(7,"mean y", *(it+7)+(double(bestMovementY)-1.)*std::sqrt(*(it+1)), parDistanceXY);
525  Gauss3D->SetVariable(8,"mean z", *(it+8)+(double(bestMovementZ)-1.)*std::sqrt(*(it+2)), parDistanceZ);
526 
527  // Set the central positions of the centroid for vertex rejection
528  xPos = Gauss3D->X()[6];
529  yPos = Gauss3D->X()[7];
530  zPos = Gauss3D->X()[8];
531 
532  // Set dimensions of the centroid for vertex rejection
533  maxTransRadius = nSigmaXY * std::sqrt(std::fabs(Gauss3D->X()[0]) + std::fabs(Gauss3D->X()[1])) / 2.;
534  maxLongLength = nSigmaZ * std::sqrt(std::fabs(Gauss3D->X()[2]));
535 
536  Gauss3D->Minimize();
537  goodData = Gauss3D->Status();
538  edm = Gauss3D->Edm();
539 
540  if (counterVx < minNentries) goodData = -2;
541  else if (isNotFinite(edm) == true) { goodData = -1; if (internalDebug == true) cout << "[Vx3DHLTAnalyzer]::\tNot finite edm !" << endl; }
542  else for (unsigned int j = 0; j < nParams; j++)
543  if (isNotFinite(Gauss3D->Errors()[j]) == true)
544  {
545  goodData = -3;
546  if (internalDebug == true) cout << "[Vx3DHLTAnalyzer]::\tNot finite errors !" << endl;
547  break;
548  }
549  if (goodData == 0)
550  {
551  covyz = Gauss3D->X()[4]*(std::fabs(Gauss3D->X()[2])-std::fabs(Gauss3D->X()[1])) - Gauss3D->X()[5]*Gauss3D->X()[3];
552  covxz = Gauss3D->X()[5]*(std::fabs(Gauss3D->X()[2])-std::fabs(Gauss3D->X()[0])) - Gauss3D->X()[4]*Gauss3D->X()[3];
553 
554  det = std::fabs(Gauss3D->X()[0]) * (std::fabs(Gauss3D->X()[1])*std::fabs(Gauss3D->X()[2]) - covyz*covyz) -
555  Gauss3D->X()[3] * (Gauss3D->X()[3]*std::fabs(Gauss3D->X()[2]) - covxz*covyz) +
556  covxz * (Gauss3D->X()[3]*covyz - covxz*std::fabs(Gauss3D->X()[1]));
557  if (det < 0.) { goodData = -4; if (internalDebug == true) cout << "[Vx3DHLTAnalyzer]::\tNegative determinant !" << endl; }
558  }
559 
560  // @@@ FIT WITH DIFFERENT PARAMETER DISTANCES @@@
561  for (unsigned int i = 0; i < trials; i++)
562  {
563  if ((goodData != 0) && (goodData != -2))
564  {
565  Gauss3D->Clear();
566 
567  if (internalDebug == true) cout << "[Vx3DHLTAnalyzer]::\tFIT WITH DIFFERENT PARAMETER DISTANCES - STEP " << i+1 << endl;
568 
569  Gauss3D->SetVariable(0,"var x ", *(it+0), parDistanceXY * parDistanceXY * largerDist[i]);
570  Gauss3D->SetVariable(1,"var y ", *(it+1), parDistanceXY * parDistanceXY * largerDist[i]);
571  Gauss3D->SetVariable(2,"var z ", *(it+2), parDistanceZ * parDistanceZ * largerDist[i]);
572  Gauss3D->SetVariable(3,"cov xy", *(it+3), parDistanceCxy * largerDist[i]);
573  Gauss3D->SetVariable(4,"dydz ", *(it+4), parDistanceddZ * largerDist[i]);
574  Gauss3D->SetVariable(5,"dxdz ", *(it+5), parDistanceddZ * largerDist[i]);
575  Gauss3D->SetVariable(6,"mean x", *(it+6)+(double(bestMovementX)-1.)*std::sqrt(*(it+0)), parDistanceXY * largerDist[i]);
576  Gauss3D->SetVariable(7,"mean y", *(it+7)+(double(bestMovementY)-1.)*std::sqrt(*(it+1)), parDistanceXY * largerDist[i]);
577  Gauss3D->SetVariable(8,"mean z", *(it+8)+(double(bestMovementZ)-1.)*std::sqrt(*(it+2)), parDistanceZ * largerDist[i]);
578 
579  // Set the central positions of the centroid for vertex rejection
580  xPos = Gauss3D->X()[6];
581  yPos = Gauss3D->X()[7];
582  zPos = Gauss3D->X()[8];
583 
584  // Set dimensions of the centroid for vertex rejection
585  maxTransRadius = nSigmaXY * std::sqrt(std::fabs(Gauss3D->X()[0]) + std::fabs(Gauss3D->X()[1])) / 2.;
586  maxLongLength = nSigmaZ * std::sqrt(std::fabs(Gauss3D->X()[2]));
587 
588  Gauss3D->Minimize();
589  goodData = Gauss3D->Status();
590  edm = Gauss3D->Edm();
591 
592  if (counterVx < minNentries) goodData = -2;
593  else if (isNotFinite(edm) == true) { goodData = -1; if (internalDebug == true) cout << "[Vx3DHLTAnalyzer]::\tNot finite edm !" << endl; }
594  else for (unsigned int j = 0; j < nParams; j++)
595  if (isNotFinite(Gauss3D->Errors()[j]) == true)
596  {
597  goodData = -3;
598  if (internalDebug == true) cout << "[Vx3DHLTAnalyzer]::\tNot finite errors !" << endl;
599  break;
600  }
601  if (goodData == 0)
602  {
603  covyz = Gauss3D->X()[4]*(std::fabs(Gauss3D->X()[2])-std::fabs(Gauss3D->X()[1])) - Gauss3D->X()[5]*Gauss3D->X()[3];
604  covxz = Gauss3D->X()[5]*(std::fabs(Gauss3D->X()[2])-std::fabs(Gauss3D->X()[0])) - Gauss3D->X()[4]*Gauss3D->X()[3];
605 
606  det = std::fabs(Gauss3D->X()[0]) * (std::fabs(Gauss3D->X()[1])*std::fabs(Gauss3D->X()[2]) - covyz*covyz) -
607  Gauss3D->X()[3] * (Gauss3D->X()[3]*std::fabs(Gauss3D->X()[2]) - covxz*covyz) +
608  covxz * (Gauss3D->X()[3]*covyz - covxz*std::fabs(Gauss3D->X()[1]));
609  if (det < 0.) { goodData = -4; if (internalDebug == true) cout << "[Vx3DHLTAnalyzer]::\tNegative determinant !" << endl; }
610  }
611  } else break;
612  }
613 
614  if (goodData == 0)
615  for (unsigned int i = 0; i < nParams; i++)
616  {
617  vals->operator[](i) = Gauss3D->X()[i];
618  vals->operator[](i+nParams) = Gauss3D->Errors()[i];
619  }
620 
621  delete Gauss3D;
622  return goodData;
623  }
624 
625  return -1;
626 }
unsigned int minNentries
#define NULL
Definition: scimark2.h:8
double Gauss3DFunc(const double *par)
unsigned int nParams
bool isNotFinite(T x)
Definition: isFinite.h:10
unsigned int counterVx
T sqrt(T t)
Definition: SSEVec.h:18
HLT enums.
void Vx3DHLTAnalyzer::printFitParams ( const std::vector< double > &  fitResults)
private

Definition at line 876 of file Vx3DHLTAnalyzer.cc.

References gather_cfg::cout.

877 {
878  cout << "var x --> " << fitResults[0] << " +/- " << fitResults[0+nParams] << endl;
879  cout << "var y --> " << fitResults[1] << " +/- " << fitResults[1+nParams] << endl;
880  cout << "var z --> " << fitResults[2] << " +/- " << fitResults[2+nParams] << endl;
881  cout << "cov xy --> " << fitResults[3] << " +/- " << fitResults[3+nParams] << endl;
882  cout << "dydz --> " << fitResults[4] << " +/- " << fitResults[4+nParams] << endl;
883  cout << "dxdz --> " << fitResults[5] << " +/- " << fitResults[5+nParams] << endl;
884  cout << "mean x --> " << fitResults[6] << " +/- " << fitResults[6+nParams] << endl;
885  cout << "mean y --> " << fitResults[7] << " +/- " << fitResults[7+nParams] << endl;
886  cout << "mean z --> " << fitResults[8] << " +/- " << fitResults[8+nParams] << endl;
887 }
unsigned int nParams
MonitorElement * fitResults
void Vx3DHLTAnalyzer::reset ( std::string  ResetType)
private

Definition at line 629 of file Vx3DHLTAnalyzer.cc.

References gather_cfg::cout, edm::service::formatTime(), convertSQLiteXML::runNumber, and fftjetpfpileupcleaner_cfi::Vertices.

630 {
631  if ((debugMode == true) && (outputDebugFile.is_open() == true))
632  {
633  outputDebugFile << "Runnumber " << runNumber << endl;
634  outputDebugFile << "BeginTimeOfFit " << formatTime(beginTimeOfFit >> 32) << " " << (beginTimeOfFit >> 32) << endl;
635  outputDebugFile << "BeginLumiRange " << beginLumiOfFit << endl;
636  outputDebugFile << "EndTimeOfFit " << formatTime(endTimeOfFit >> 32) << " " << (endTimeOfFit >> 32) << endl;
637  outputDebugFile << "EndLumiRange " << endLumiOfFit << endl;
638  outputDebugFile << "LumiCounter " << lumiCounter << endl;
639  outputDebugFile << "LastLumiOfFit " << lastLumiOfFit << endl;
640  }
641 
642 
643  if (ResetType.compare("scratch") == 0)
644  {
645  runNumber = 0;
646  numberGoodFits = 0;
647  numberFits = 0;
648  lastLumiOfFit = 0;
649 
650  Vx_X->Reset();
651  Vx_Y->Reset();
652  Vx_Z->Reset();
653 
654  Vx_ZX->Reset();
655  Vx_ZY->Reset();
656  Vx_XY->Reset();
657 
658  Vx_X_Cum->Reset();
659  Vx_Y_Cum->Reset();
660  Vx_Z_Cum->Reset();
661 
662  Vx_ZX_Cum->Reset();
663  Vx_ZY_Cum->Reset();
664  Vx_XY_Cum->Reset();
665 
666  mXlumi->Reset();
667  mYlumi->Reset();
668  mZlumi->Reset();
669 
670  sXlumi->Reset();
671  sYlumi->Reset();
672  sZlumi->Reset();
673 
674  dxdzlumi->Reset();
675  dydzlumi->Reset();
676 
677  hitCounter->Reset();
678  goodVxCounter->Reset();
679  statusCounter->Reset();
680  fitResults->Reset();
681 
682  reportSummary->Fill(-1);
683  reportSummaryMap->getTH1()->SetBinContent(1, 1, -1);
684 
685  Vertices.clear();
686 
687  lumiCounter = 0;
688  totalHits = 0;
689  beginTimeOfFit = 0;
690  endTimeOfFit = 0;
691  beginLumiOfFit = 0;
692  endLumiOfFit = 0;
693 
694  if (internalDebug == true) cout << "[Vx3DHLTAnalyzer]::\tReset issued: scratch" << endl;
695  if ((debugMode == true) && (outputDebugFile.is_open() == true)) outputDebugFile << "Reset -scratch- issued\n" << endl;
696  }
697  else if (ResetType.compare("whole") == 0)
698  {
699  Vx_X->Reset();
700  Vx_Y->Reset();
701  Vx_Z->Reset();
702 
703  Vx_ZX->Reset();
704  Vx_ZY->Reset();
705  Vx_XY->Reset();
706 
707  Vertices.clear();
708 
709  lumiCounter = 0;
710  totalHits = 0;
711  beginTimeOfFit = 0;
712  endTimeOfFit = 0;
713  beginLumiOfFit = 0;
714  endLumiOfFit = 0;
715 
716  if (internalDebug == true) cout << "[Vx3DHLTAnalyzer]::\tReset issued: whole" << endl;
717  if ((debugMode == true) && (outputDebugFile.is_open() == true)) outputDebugFile << "Reset -whole- issued\n" << endl;
718  }
719  else if (ResetType.compare("hitCounter") == 0)
720  {
721  totalHits = 0;
722 
723  if (internalDebug == true) cout << "[Vx3DHLTAnalyzer]::\tReset issued: hitCounter" << endl;
724  if ((debugMode == true) && (outputDebugFile.is_open() == true)) outputDebugFile << "Reset -hitCounter- issued\n" << endl;
725  }
726 }
unsigned int lumiCounter
MonitorElement * statusCounter
MonitorElement * dxdzlumi
MonitorElement * Vx_ZX
unsigned int totalHits
unsigned int numberFits
MonitorElement * Vx_Y_Cum
unsigned int beginLumiOfFit
MonitorElement * Vx_X
MonitorElement * mYlumi
edm::TimeValue_t beginTimeOfFit
edm::TimeValue_t endTimeOfFit
MonitorElement * sYlumi
MonitorElement * reportSummaryMap
void Fill(long long x)
MonitorElement * Vx_XY
MonitorElement * sZlumi
MonitorElement * fitResults
MonitorElement * Vx_ZY
std::string formatTime(const time_t &t)
unsigned int endLumiOfFit
unsigned int numberGoodFits
MonitorElement * reportSummary
MonitorElement * Vx_ZY_Cum
MonitorElement * goodVxCounter
std::ofstream outputDebugFile
MonitorElement * dydzlumi
TH1 * getTH1(void) const
MonitorElement * Vx_ZX_Cum
MonitorElement * Vx_Z
MonitorElement * mXlumi
MonitorElement * Vx_X_Cum
std::vector< VertexType > Vertices
MonitorElement * mZlumi
MonitorElement * sXlumi
unsigned int lastLumiOfFit
MonitorElement * Vx_XY_Cum
unsigned int runNumber
MonitorElement * Vx_Z_Cum
MonitorElement * hitCounter
void Reset(void)
reset ME (ie. contents, errors, etc)
MonitorElement * Vx_Y
void Vx3DHLTAnalyzer::writeToFile ( std::vector< double > *  vals,
edm::TimeValue_t  BeginTimeOfFit,
edm::TimeValue_t  EndTimeOfFit,
unsigned int  BeginLumiOfFit,
unsigned int  EndLumiOfFit,
int  dataType 
)
private

Definition at line 729 of file Vx3DHLTAnalyzer.cc.

References MillePedeFileConverter_cfg::fileName, edm::service::formatTime(), NULL, MillePedeFileConverter_cfg::out, download_sqlite_cfg::outputFile, convertSQLiteXML::runNumber, and mathSSE::sqrt().

735 {
736  stringstream BufferString;
737  BufferString.precision(5);
738 
739  outputFile.open(fileName.c_str(), ios::out);
740 
741  if ((outputFile.is_open() == true) && (vals != NULL) && (vals->size() == (nParams-1)*2))
742  {
743  vector<double>::const_iterator it = vals->begin();
744 
745  outputFile << "Runnumber " << runNumber << endl;
746  outputFile << "BeginTimeOfFit " << formatTime(beginTimeOfFit >> 32) << " " << (beginTimeOfFit >> 32) << endl;
747  outputFile << "EndTimeOfFit " << formatTime(endTimeOfFit >> 32) << " " << (endTimeOfFit >> 32) << endl;
748  outputFile << "LumiRange " << beginLumiOfFit << " - " << endLumiOfFit << endl;
749  outputFile << "Type " << dataType << endl;
750  // 3D Vertexing with Pixel Tracks:
751  // Good data = Type 3
752  // Bad data = Type -1
753 
754  BufferString << *(it+0);
755  outputFile << "X0 " << BufferString.str().c_str() << endl;
756  BufferString.str("");
757 
758  BufferString << *(it+1);
759  outputFile << "Y0 " << BufferString.str().c_str() << endl;
760  BufferString.str("");
761 
762  BufferString << *(it+2);
763  outputFile << "Z0 " << BufferString.str().c_str() << endl;
764  BufferString.str("");
765 
766  BufferString << *(it+5);
767  outputFile << "sigmaZ0 " << BufferString.str().c_str() << endl;
768  BufferString.str("");
769 
770  BufferString << *(it+6);
771  outputFile << "dxdz " << BufferString.str().c_str() << endl;
772  BufferString.str("");
773 
774  BufferString << *(it+7);
775  outputFile << "dydz " << BufferString.str().c_str() << endl;
776  BufferString.str("");
777 
778  BufferString << *(it+3);
779  outputFile << "BeamWidthX " << BufferString.str().c_str() << endl;
780  BufferString.str("");
781 
782  BufferString << *(it+4);
783  outputFile << "BeamWidthY " << BufferString.str().c_str() << endl;
784  BufferString.str("");
785 
786  outputFile << "Cov(0,j) " << *(it+8) << " 0 0 0 0 0 0" << endl;
787  outputFile << "Cov(1,j) 0 " << *(it+9) << " 0 0 0 0 0" << endl;
788  outputFile << "Cov(2,j) 0 0 " << *(it+10) << " 0 0 0 0" << endl;
789  outputFile << "Cov(3,j) 0 0 0 " << *(it+13) << " 0 0 0" << endl;
790  outputFile << "Cov(4,j) 0 0 0 0 " << *(it+14) << " 0 0" << endl;
791  outputFile << "Cov(5,j) 0 0 0 0 0 " << *(it+15) << " 0" << endl;
792  outputFile << "Cov(6,j) 0 0 0 0 0 0 " << ((*(it+11)) + (*(it+12)) + 2.*std::sqrt((*(it+11))*(*(it+12)))) / 4. << endl;
793 
794  outputFile << "EmittanceX 0" << endl;
795  outputFile << "EmittanceY 0" << endl;
796  outputFile << "BetaStar 0" << endl;
797  outputFile << "events 0" << endl;
798  outputFile << "meanPV 0" << endl;
799  outputFile << "meanErrPV 0" << endl;
800  outputFile << "rmsPV 0" << endl;
801  outputFile << "rmsErrPV 0" << endl;
802  outputFile << "maxPV 0" << endl;
803  outputFile << "nPV 0" << endl;
804  }
805  outputFile.close();
806 
807  if ((debugMode == true) && (outputDebugFile.is_open() == true) && (vals != NULL) && (vals->size() == (nParams-1)*2))
808  {
809  vector<double>::const_iterator it = vals->begin();
810 
811  outputDebugFile << "Runnumber " << runNumber << endl;
812  outputDebugFile << "BeginTimeOfFit " << formatTime(beginTimeOfFit >> 32) << " " << (beginTimeOfFit >> 32) << endl;
813  outputDebugFile << "EndTimeOfFit " << formatTime(endTimeOfFit >> 32) << " " << (endTimeOfFit >> 32) << endl;
814  outputDebugFile << "LumiRange " << beginLumiOfFit << " - " << endLumiOfFit << endl;
815  outputDebugFile << "Type " << dataType << endl;
816  // 3D Vertexing with Pixel Tracks:
817  // Good data = Type 3
818  // Bad data = Type -1
819 
820  BufferString << *(it+0);
821  outputDebugFile << "X0 " << BufferString.str().c_str() << endl;
822  BufferString.str("");
823 
824  BufferString << *(it+1);
825  outputDebugFile << "Y0 " << BufferString.str().c_str() << endl;
826  BufferString.str("");
827 
828  BufferString << *(it+2);
829  outputDebugFile << "Z0 " << BufferString.str().c_str() << endl;
830  BufferString.str("");
831 
832  BufferString << *(it+5);
833  outputDebugFile << "sigmaZ0 " << BufferString.str().c_str() << endl;
834  BufferString.str("");
835 
836  BufferString << *(it+6);
837  outputDebugFile << "dxdz " << BufferString.str().c_str() << endl;
838  BufferString.str("");
839 
840  BufferString << *(it+7);
841  outputDebugFile << "dydz " << BufferString.str().c_str() << endl;
842  BufferString.str("");
843 
844  BufferString << *(it+3);
845  outputDebugFile << "BeamWidthX " << BufferString.str().c_str() << endl;
846  BufferString.str("");
847 
848  BufferString << *(it+4);
849  outputDebugFile << "BeamWidthY " << BufferString.str().c_str() << endl;
850  BufferString.str("");
851 
852  outputDebugFile << "Cov(0,j) " << *(it+8) << " 0 0 0 0 0 0" << endl;
853  outputDebugFile << "Cov(1,j) 0 " << *(it+9) << " 0 0 0 0 0" << endl;
854  outputDebugFile << "Cov(2,j) 0 0 " << *(it+10) << " 0 0 0 0" << endl;
855  outputDebugFile << "Cov(3,j) 0 0 0 " << *(it+13) << " 0 0 0" << endl;
856  outputDebugFile << "Cov(4,j) 0 0 0 0 " << *(it+14) << " 0 0" << endl;
857  outputDebugFile << "Cov(5,j) 0 0 0 0 0 " << *(it+15) << " 0" << endl;
858  outputDebugFile << "Cov(6,j) 0 0 0 0 0 0 " << ((*(it+11)) + (*(it+12)) + 2.*std::sqrt((*(it+11))*(*(it+12)))) / 4. << endl;
859 
860  outputDebugFile << "EmittanceX 0" << endl;
861  outputDebugFile << "EmittanceY 0" << endl;
862  outputDebugFile << "BetaStar 0" << endl;
863  outputDebugFile << "events 0" << endl;
864  outputDebugFile << "meanPV 0" << endl;
865  outputDebugFile << "meanErrPV 0" << endl;
866  outputDebugFile << "rmsPV 0" << endl;
867  outputDebugFile << "rmsErrPV 0" << endl;
868  outputDebugFile << "maxPV 0" << endl;
869  outputDebugFile << "nPV 0" << endl;
870 
871  outputDebugFile << "\n" << "Used vertices: " << counterVx << "\n" << endl;
872  }
873 }
unsigned int beginLumiOfFit
#define NULL
Definition: scimark2.h:8
edm::TimeValue_t beginTimeOfFit
edm::TimeValue_t endTimeOfFit
unsigned int nParams
unsigned int counterVx
std::string fileName
std::string formatTime(const time_t &t)
unsigned int endLumiOfFit
T sqrt(T t)
Definition: SSEVec.h:18
std::ofstream outputDebugFile
std::ofstream outputFile
unsigned int runNumber

Member Data Documentation

unsigned int Vx3DHLTAnalyzer::beginLumiOfFit
private

Definition at line 153 of file Vx3DHLTAnalyzer.h.

edm::TimeValue_t Vx3DHLTAnalyzer::beginTimeOfFit
private

Definition at line 146 of file Vx3DHLTAnalyzer.h.

bool Vx3DHLTAnalyzer::considerVxCovariance
private

Definition at line 160 of file Vx3DHLTAnalyzer.h.

unsigned int Vx3DHLTAnalyzer::counterVx
private

Definition at line 161 of file Vx3DHLTAnalyzer.h.

bool Vx3DHLTAnalyzer::dataFromFit
private

Definition at line 84 of file Vx3DHLTAnalyzer.h.

bool Vx3DHLTAnalyzer::debugMode
private

Definition at line 83 of file Vx3DHLTAnalyzer.h.

MonitorElement* Vx3DHLTAnalyzer::dxdzlumi
private

Definition at line 112 of file Vx3DHLTAnalyzer.h.

MonitorElement* Vx3DHLTAnalyzer::dydzlumi
private

Definition at line 113 of file Vx3DHLTAnalyzer.h.

unsigned int Vx3DHLTAnalyzer::endLumiOfFit
private

Definition at line 154 of file Vx3DHLTAnalyzer.h.

edm::TimeValue_t Vx3DHLTAnalyzer::endTimeOfFit
private

Definition at line 147 of file Vx3DHLTAnalyzer.h.

std::string Vx3DHLTAnalyzer::fileName
private

Definition at line 98 of file Vx3DHLTAnalyzer.h.

Referenced by readConfig.fileINI::read().

MonitorElement* Vx3DHLTAnalyzer::fitResults
private

Definition at line 138 of file Vx3DHLTAnalyzer.h.

MonitorElement* Vx3DHLTAnalyzer::goodVxCounter
private

Definition at line 131 of file Vx3DHLTAnalyzer.h.

MonitorElement* Vx3DHLTAnalyzer::hitCounter
private

Definition at line 132 of file Vx3DHLTAnalyzer.h.

bool Vx3DHLTAnalyzer::internalDebug
private

Definition at line 157 of file Vx3DHLTAnalyzer.h.

unsigned int Vx3DHLTAnalyzer::lastLumiOfFit
private

Definition at line 155 of file Vx3DHLTAnalyzer.h.

unsigned int Vx3DHLTAnalyzer::lumiCounter
private

Definition at line 149 of file Vx3DHLTAnalyzer.h.

double Vx3DHLTAnalyzer::maxLongLength
private

Definition at line 163 of file Vx3DHLTAnalyzer.h.

unsigned int Vx3DHLTAnalyzer::maxLumiIntegration
private

Definition at line 86 of file Vx3DHLTAnalyzer.h.

double Vx3DHLTAnalyzer::maxTransRadius
private

Definition at line 162 of file Vx3DHLTAnalyzer.h.

unsigned int Vx3DHLTAnalyzer::minNentries
private

Definition at line 88 of file Vx3DHLTAnalyzer.h.

double Vx3DHLTAnalyzer::minVxDoF
private

Definition at line 96 of file Vx3DHLTAnalyzer.h.

double Vx3DHLTAnalyzer::minVxWgt
private

Definition at line 97 of file Vx3DHLTAnalyzer.h.

MonitorElement* Vx3DHLTAnalyzer::mXlumi
private

Definition at line 104 of file Vx3DHLTAnalyzer.h.

MonitorElement* Vx3DHLTAnalyzer::mYlumi
private

Definition at line 105 of file Vx3DHLTAnalyzer.h.

MonitorElement* Vx3DHLTAnalyzer::mZlumi
private

Definition at line 106 of file Vx3DHLTAnalyzer.h.

unsigned int Vx3DHLTAnalyzer::nLumiFit
private

Definition at line 85 of file Vx3DHLTAnalyzer.h.

unsigned int Vx3DHLTAnalyzer::nLumiXaxisRange
private

Definition at line 87 of file Vx3DHLTAnalyzer.h.

unsigned int Vx3DHLTAnalyzer::nParams
private

Definition at line 156 of file Vx3DHLTAnalyzer.h.

unsigned int Vx3DHLTAnalyzer::numberFits
private

Definition at line 152 of file Vx3DHLTAnalyzer.h.

unsigned int Vx3DHLTAnalyzer::numberGoodFits
private

Definition at line 151 of file Vx3DHLTAnalyzer.h.

std::ofstream Vx3DHLTAnalyzer::outputDebugFile
private

Definition at line 145 of file Vx3DHLTAnalyzer.h.

std::ofstream Vx3DHLTAnalyzer::outputFile
private

Definition at line 144 of file Vx3DHLTAnalyzer.h.

double Vx3DHLTAnalyzer::pi
private

Definition at line 165 of file Vx3DHLTAnalyzer.h.

edm::EDGetTokenT<SiPixelRecHitCollection> Vx3DHLTAnalyzer::pixelHitCollection
private

Definition at line 82 of file Vx3DHLTAnalyzer.h.

MonitorElement* Vx3DHLTAnalyzer::reportSummary
private

Definition at line 135 of file Vx3DHLTAnalyzer.h.

MonitorElement* Vx3DHLTAnalyzer::reportSummaryMap
private

Definition at line 136 of file Vx3DHLTAnalyzer.h.

unsigned int Vx3DHLTAnalyzer::runNumber
private

Definition at line 148 of file Vx3DHLTAnalyzer.h.

MonitorElement* Vx3DHLTAnalyzer::statusCounter
private

Definition at line 133 of file Vx3DHLTAnalyzer.h.

MonitorElement* Vx3DHLTAnalyzer::sXlumi
private

Definition at line 108 of file Vx3DHLTAnalyzer.h.

MonitorElement* Vx3DHLTAnalyzer::sYlumi
private

Definition at line 109 of file Vx3DHLTAnalyzer.h.

MonitorElement* Vx3DHLTAnalyzer::sZlumi
private

Definition at line 110 of file Vx3DHLTAnalyzer.h.

unsigned int Vx3DHLTAnalyzer::totalHits
private

Definition at line 150 of file Vx3DHLTAnalyzer.h.

edm::EDGetTokenT<reco::VertexCollection> Vx3DHLTAnalyzer::vertexCollection
private

Definition at line 81 of file Vx3DHLTAnalyzer.h.

std::vector<VertexType> Vx3DHLTAnalyzer::Vertices
private

Definition at line 159 of file Vx3DHLTAnalyzer.h.

MonitorElement* Vx3DHLTAnalyzer::Vx_X
private

Definition at line 115 of file Vx3DHLTAnalyzer.h.

MonitorElement* Vx3DHLTAnalyzer::Vx_X_Cum
private

Definition at line 123 of file Vx3DHLTAnalyzer.h.

MonitorElement* Vx3DHLTAnalyzer::Vx_XY
private

Definition at line 121 of file Vx3DHLTAnalyzer.h.

MonitorElement* Vx3DHLTAnalyzer::Vx_XY_Cum
private

Definition at line 129 of file Vx3DHLTAnalyzer.h.

MonitorElement* Vx3DHLTAnalyzer::Vx_Y
private

Definition at line 116 of file Vx3DHLTAnalyzer.h.

MonitorElement* Vx3DHLTAnalyzer::Vx_Y_Cum
private

Definition at line 124 of file Vx3DHLTAnalyzer.h.

MonitorElement* Vx3DHLTAnalyzer::Vx_Z
private

Definition at line 117 of file Vx3DHLTAnalyzer.h.

MonitorElement* Vx3DHLTAnalyzer::Vx_Z_Cum
private

Definition at line 125 of file Vx3DHLTAnalyzer.h.

MonitorElement* Vx3DHLTAnalyzer::Vx_ZX
private

Definition at line 119 of file Vx3DHLTAnalyzer.h.

MonitorElement* Vx3DHLTAnalyzer::Vx_ZX_Cum
private

Definition at line 127 of file Vx3DHLTAnalyzer.h.

MonitorElement* Vx3DHLTAnalyzer::Vx_ZY
private

Definition at line 120 of file Vx3DHLTAnalyzer.h.

MonitorElement* Vx3DHLTAnalyzer::Vx_ZY_Cum
private

Definition at line 128 of file Vx3DHLTAnalyzer.h.

double Vx3DHLTAnalyzer::VxErrCorr
private

Definition at line 95 of file Vx3DHLTAnalyzer.h.

double Vx3DHLTAnalyzer::xPos
private

Definition at line 164 of file Vx3DHLTAnalyzer.h.

double Vx3DHLTAnalyzer::xRange
private

Definition at line 89 of file Vx3DHLTAnalyzer.h.

double Vx3DHLTAnalyzer::xStep
private

Definition at line 90 of file Vx3DHLTAnalyzer.h.

double Vx3DHLTAnalyzer::yPos
private

Definition at line 164 of file Vx3DHLTAnalyzer.h.

double Vx3DHLTAnalyzer::yRange
private

Definition at line 91 of file Vx3DHLTAnalyzer.h.

double Vx3DHLTAnalyzer::yStep
private

Definition at line 92 of file Vx3DHLTAnalyzer.h.

double Vx3DHLTAnalyzer::zPos
private

Definition at line 164 of file Vx3DHLTAnalyzer.h.

double Vx3DHLTAnalyzer::zRange
private

Definition at line 93 of file Vx3DHLTAnalyzer.h.

double Vx3DHLTAnalyzer::zStep
private

Definition at line 94 of file Vx3DHLTAnalyzer.h.