CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
List of all members | Public Member Functions | Private Member Functions | Private Attributes
BeamFitter Class Reference

#include <BeamFitter.h>

Public Member Functions

 BeamFitter ()
 
 BeamFitter (const edm::ParameterSet &iConfig, edm::ConsumesCollector &&iColl)
 
void dumpBWTxtFile (std::string &)
 
void dumpTxtFile (std::string &, bool)
 
reco::BeamSpot getBeamSpot ()
 
std::map< int, reco::BeamSpotgetBeamSpotMap ()
 
reco::BeamSpot getBeamWidth ()
 
std::vector< BSTrkParametersgetBSvector ()
 
TH1F * getCutFlow ()
 
std::pair< int, int > getFitLSRange ()
 
int getNPVs ()
 
const std::map< int, int > & getNPVsperBX ()
 
int getNTracks ()
 
std::size_t getPVvectorSize ()
 
std::pair< time_t, time_t > getRefTime ()
 
int getRunNumber ()
 
void readEvent (const edm::Event &iEvent)
 
void resetCutFlow ()
 
void resetLSRange ()
 
void resetPVFitter ()
 
void resetRefTime ()
 
void resetTotTrk ()
 
void resetTrkVector ()
 
void resizeBSvector (unsigned int nsize)
 
void resizePVvector (unsigned int npvsize)
 
void runAllFitter ()
 
bool runBeamWidthFitter ()
 
bool runFitter ()
 
bool runFitterNoTxt ()
 
bool runPVandTrkFitter ()
 
void setFitLSRange (int ls0, int ls1)
 
void SetPVInfo (const std::vector< float > &v1_)
 
void setRefTime (time_t t0, time_t t1)
 
void setRun (int run)
 
void subtractFromCutFlow (const TH1F *toSubtract)
 
void write2DB ()
 
virtual ~BeamFitter ()
 

Private Member Functions

const char * formatBTime (const std::time_t &)
 
void updateBTime ()
 

Private Attributes

std::vector
< reco::TrackBase::TrackAlgorithm
algorithm_
 
bool appendRunTxt_
 
edm::EDGetTokenT< reco::BeamSpotbeamSpotToken_
 
double convergence_
 
int countPass [9]
 
bool debug_
 
bool falgo
 
std::ofstream fasciiDIP
 
std::ofstream fasciiFile
 
reco::BeamSpot fbeamspot
 
reco::BeamSpot fbeamWidthFit
 
int fbeginLumiOfFit
 
char fbeginTimeOfFit [32]
 
std::map< int, reco::BeamSpotfbspotPVMap
 
std::vector< BSTrkParametersfBSvector
 
int fcharge
 
double fcov [7][7]
 
double fd0
 
double fd0bs
 
double fd0phi_chi2
 
double fd0phi_d0
 
double fdxdz
 
double fdxdzErr
 
double fdydz
 
double fdydzErr
 
int fendLumiOfFit
 
char fendTimeOfFit [32]
 
double feta
 
bool ffilename_changed
 
TFile * file_
 
bool fitted_
 
int flumi
 
BSFitterfmyalgo
 
double fnormchi2
 
int fnPixelLayerMeas
 
int fnPXBLayerMeas
 
int fnPXFLayerMeas
 
int fnStripLayerMeas
 
int fnTECLayerMeas
 
int fnTIBLayerMeas
 
int fnTIDLayerMeas
 
int fnTOBLayerMeas
 
int fnTotLayerMeas
 
std::vector< float > ForDIPPV_
 
double fphi0
 
double fpt
 
TTree * fPVTree_
 
bool fpvValid
 
double fpvx
 
double fpvy
 
double fpvz
 
bool fquality
 
std::time_t freftime [2]
 
int frun
 
int frunFit
 
double fsigmad0
 
double fsigmaZ
 
double fsigmaz0
 
double fsigmaZErr
 
double ftheta
 
int ftotal_tracks
 
TTree * ftree_
 
TTree * ftreeFit_
 
double fvx
 
double fvy
 
double fwidthX
 
double fwidthXErr
 
double fwidthY
 
double fwidthYErr
 
double fx
 
double fxErr
 
double fy
 
double fyErr
 
double fz
 
double fz0
 
double fzErr
 
TH1F * h1cutFlow
 
TH1F * h1ntrks
 
TH1F * h1vz_event
 
TH1F * h1z
 
double inputBeamWidth_
 
bool isMuon_
 
int min_Ntrks_
 
PVFitterMyPVFitter
 
std::string outputDIPTxt_
 
std::string outputfilename_
 
std::string outputTxt_
 
std::vector
< reco::TrackBase::TrackQuality
quality_
 
bool saveBeamFit_
 
bool saveNtuple_
 
bool savePVVertices_
 
edm::EDGetTokenT
< reco::TrackCollection
tracksToken_
 
std::vector< std::string > trk_Algorithm_
 
double trk_MaxEta_
 
double trk_MaxIP_
 
double trk_MaxNormChi2_
 
double trk_MaxZ_
 
int trk_MinNPixLayers_
 
int trk_MinNTotLayers_
 
double trk_MinpT_
 
std::vector< std::string > trk_Quality_
 
edm::EDGetTokenT< edm::View
< reco::Vertex > > 
vertexToken_
 
bool writeDIPBadFit_
 
bool writeDIPTxt_
 
bool writeTxt_
 

Detailed Description

Definition at line 38 of file BeamFitter.h.

Constructor & Destructor Documentation

BeamFitter::BeamFitter ( )
inline

Definition at line 40 of file BeamFitter.h.

40 {}
BeamFitter::BeamFitter ( const edm::ParameterSet iConfig,
edm::ConsumesCollector &&  iColl 
)

Definition at line 48 of file BeamFitter.cc.

References reco::TrackBase::algoByName(), algorithm_, appendRunTxt_, beamSpotToken_, convergence_, debug_, falgo, fasciiDIP, fbeginLumiOfFit, fbeginTimeOfFit, fBSvector, fcharge, fcov, fd0, fd0bs, fdxdz, fdxdzErr, fdydz, fdydzErr, fendLumiOfFit, fendTimeOfFit, feta, ffilename_changed, file_, fitted_, flumi, fnormchi2, fnPixelLayerMeas, fnPXBLayerMeas, fnPXFLayerMeas, fnStripLayerMeas, fnTECLayerMeas, fnTIBLayerMeas, fnTIDLayerMeas, fnTOBLayerMeas, fnTotLayerMeas, fphi0, fpt, fPVTree_, fpvValid, fpvx, fpvy, fpvz, fquality, frun, frunFit, fsigmad0, fsigmaZ, fsigmaz0, fsigmaZErr, ftheta, ftotal_tracks, ftree_, ftreeFit_, fvx, fvy, fwidthX, fwidthXErr, fwidthY, fwidthYErr, fx, fxErr, fy, fyErr, fz, fz0, fzErr, edm::ParameterSet::getParameter(), edm::ParameterSet::getUntrackedParameter(), h1cutFlow, h1ntrks, h1vz_event, inputBeamWidth_, isMuon_, j, min_Ntrks_, MyPVFitter, outputDIPTxt_, outputfilename_, outputTxt_, quality_, reco::TrackBase::qualityByName(), PVFitter::resetAll(), resetCutFlow(), resetRefTime(), saveBeamFit_, saveNtuple_, savePVVertices_, PVFitter::setTree(), tracksToken_, trk_Algorithm_, trk_MaxEta_, trk_MaxIP_, trk_MaxNormChi2_, trk_MaxZ_, trk_MinNPixLayers_, trk_MinNTotLayers_, trk_MinpT_, trk_Quality_, vertexToken_, writeDIPBadFit_, writeDIPTxt_, and writeTxt_.

49  : fPVTree_(0)
50 {
51 
52  debug_ = iConfig.getParameter<edm::ParameterSet>("BeamFitter").getUntrackedParameter<bool>("Debug");
54  iConfig.getParameter<edm::ParameterSet>("BeamFitter").getUntrackedParameter<edm::InputTag>("TrackCollection"));
56  iConfig.getUntrackedParameter<edm::InputTag>("primaryVertex", edm::InputTag("offlinePrimaryVertices")));
58  iConfig.getUntrackedParameter<edm::InputTag>("beamSpot", edm::InputTag("offlineBeamSpot")));
59  writeTxt_ = iConfig.getParameter<edm::ParameterSet>("BeamFitter").getUntrackedParameter<bool>("WriteAscii");
60  outputTxt_ = iConfig.getParameter<edm::ParameterSet>("BeamFitter").getUntrackedParameter<std::string>("AsciiFileName");
61  appendRunTxt_ = iConfig.getParameter<edm::ParameterSet>("BeamFitter").getUntrackedParameter<bool>("AppendRunToFileName");
62  writeDIPTxt_ = iConfig.getParameter<edm::ParameterSet>("BeamFitter").getUntrackedParameter<bool>("WriteDIPAscii");
63  // Specify whether we want to write the DIP file even if the fit is failed.
64  writeDIPBadFit_ = iConfig.getParameter<edm::ParameterSet>("BeamFitter").getUntrackedParameter<bool>("WriteDIPOnBadFit", true);
65  outputDIPTxt_ = iConfig.getParameter<edm::ParameterSet>("BeamFitter").getUntrackedParameter<std::string>("DIPFileName");
66  saveNtuple_ = iConfig.getParameter<edm::ParameterSet>("BeamFitter").getUntrackedParameter<bool>("SaveNtuple");
67  saveBeamFit_ = iConfig.getParameter<edm::ParameterSet>("BeamFitter").getUntrackedParameter<bool>("SaveFitResults");
68  savePVVertices_ = iConfig.getParameter<edm::ParameterSet>("BeamFitter").getUntrackedParameter<bool>("SavePVVertices");
69  isMuon_ = iConfig.getParameter<edm::ParameterSet>("BeamFitter").getUntrackedParameter<bool>("IsMuonCollection");
70 
71  trk_MinpT_ = iConfig.getParameter<edm::ParameterSet>("BeamFitter").getUntrackedParameter<double>("MinimumPt");
72  trk_MaxEta_ = iConfig.getParameter<edm::ParameterSet>("BeamFitter").getUntrackedParameter<double>("MaximumEta");
73  trk_MaxIP_ = iConfig.getParameter<edm::ParameterSet>("BeamFitter").getUntrackedParameter<double>("MaximumImpactParameter");
74  trk_MaxZ_ = iConfig.getParameter<edm::ParameterSet>("BeamFitter").getUntrackedParameter<double>("MaximumZ");
75  trk_MinNTotLayers_ = iConfig.getParameter<edm::ParameterSet>("BeamFitter").getUntrackedParameter<int>("MinimumTotalLayers");
76  trk_MinNPixLayers_ = iConfig.getParameter<edm::ParameterSet>("BeamFitter").getUntrackedParameter<int>("MinimumPixelLayers");
77  trk_MaxNormChi2_ = iConfig.getParameter<edm::ParameterSet>("BeamFitter").getUntrackedParameter<double>("MaximumNormChi2");
78  trk_Algorithm_ = iConfig.getParameter<edm::ParameterSet>("BeamFitter").getUntrackedParameter<std::vector<std::string> >("TrackAlgorithm");
79  trk_Quality_ = iConfig.getParameter<edm::ParameterSet>("BeamFitter").getUntrackedParameter<std::vector<std::string> >("TrackQuality");
80  min_Ntrks_ = iConfig.getParameter<edm::ParameterSet>("BeamFitter").getUntrackedParameter<int>("MinimumInputTracks");
81  convergence_ = iConfig.getParameter<edm::ParameterSet>("BeamFitter").getUntrackedParameter<double>("FractionOfFittedTrks");
82  inputBeamWidth_ = iConfig.getParameter<edm::ParameterSet>("BeamFitter").getUntrackedParameter<double>("InputBeamWidth",-1.);
83 
84  for (unsigned int j=0;j<trk_Algorithm_.size();j++)
86  for (unsigned int j=0;j<trk_Quality_.size();j++)
88 
90  outputfilename_ = iConfig.getParameter<edm::ParameterSet>("BeamFitter").getUntrackedParameter<std::string>("OutputFileName");
91  file_ = TFile::Open(outputfilename_.c_str(),"RECREATE");
92  }
93  if (saveNtuple_) {
94  ftree_ = new TTree("mytree","mytree");
95  ftree_->AutoSave();
96 
97  ftree_->Branch("pt",&fpt,"fpt/D");
98  ftree_->Branch("d0",&fd0,"fd0/D");
99  ftree_->Branch("d0bs",&fd0bs,"fd0bs/D");
100  ftree_->Branch("sigmad0",&fsigmad0,"fsigmad0/D");
101  ftree_->Branch("phi0",&fphi0,"fphi0/D");
102  ftree_->Branch("z0",&fz0,"fz0/D");
103  ftree_->Branch("sigmaz0",&fsigmaz0,"fsigmaz0/D");
104  ftree_->Branch("theta",&ftheta,"ftheta/D");
105  ftree_->Branch("eta",&feta,"feta/D");
106  ftree_->Branch("charge",&fcharge,"fcharge/I");
107  ftree_->Branch("normchi2",&fnormchi2,"fnormchi2/D");
108  ftree_->Branch("nTotLayerMeas",&fnTotLayerMeas,"fnTotLayerMeas/i");
109  ftree_->Branch("nStripLayerMeas",&fnStripLayerMeas,"fnStripLayerMeas/i");
110  ftree_->Branch("nPixelLayerMeas",&fnPixelLayerMeas,"fnPixelLayerMeas/i");
111  ftree_->Branch("nTIBLayerMeas",&fnTIBLayerMeas,"fnTIBLayerMeas/i");
112  ftree_->Branch("nTOBLayerMeas",&fnTOBLayerMeas,"fnTOBLayerMeas/i");
113  ftree_->Branch("nTIDLayerMeas",&fnTIDLayerMeas,"fnTIDLayerMeas/i");
114  ftree_->Branch("nTECLayerMeas",&fnTECLayerMeas,"fnTECLayerMeas/i");
115  ftree_->Branch("nPXBLayerMeas",&fnPXBLayerMeas,"fnPXBLayerMeas/i");
116  ftree_->Branch("nPXFLayerMeas",&fnPXFLayerMeas,"fnPXFLayerMeas/i");
117  ftree_->Branch("cov",&fcov,"fcov[7][7]/D");
118  ftree_->Branch("vx",&fvx,"fvx/D");
119  ftree_->Branch("vy",&fvy,"fvy/D");
120  ftree_->Branch("quality",&fquality,"fquality/O");
121  ftree_->Branch("algo",&falgo,"falgo/O");
122  ftree_->Branch("run",&frun,"frun/i");
123  ftree_->Branch("lumi",&flumi,"flumi/i");
124  ftree_->Branch("pvValid",&fpvValid,"fpvValid/O");
125  ftree_->Branch("pvx", &fpvx, "fpvx/D");
126  ftree_->Branch("pvy", &fpvy, "fpvy/D");
127  ftree_->Branch("pvz", &fpvz, "fpvz/D");
128  }
129  if (saveBeamFit_){
130  ftreeFit_ = new TTree("fitResults","fitResults");
131  ftreeFit_->AutoSave();
132  ftreeFit_->Branch("run",&frunFit,"frunFit/i");
133  ftreeFit_->Branch("beginLumi",&fbeginLumiOfFit,"fbeginLumiOfFit/i");
134  ftreeFit_->Branch("endLumi",&fendLumiOfFit,"fendLumiOfFit/i");
135  ftreeFit_->Branch("beginTime",fbeginTimeOfFit,"fbeginTimeOfFit/C");
136  ftreeFit_->Branch("endTime",fendTimeOfFit,"fendTimeOfFit/C");
137  ftreeFit_->Branch("x",&fx,"fx/D");
138  ftreeFit_->Branch("y",&fy,"fy/D");
139  ftreeFit_->Branch("z",&fz,"fz/D");
140  ftreeFit_->Branch("sigmaZ",&fsigmaZ,"fsigmaZ/D");
141  ftreeFit_->Branch("dxdz",&fdxdz,"fdxdz/D");
142  ftreeFit_->Branch("dydz",&fdydz,"fdydz/D");
143  ftreeFit_->Branch("xErr",&fxErr,"fxErr/D");
144  ftreeFit_->Branch("yErr",&fyErr,"fyErr/D");
145  ftreeFit_->Branch("zErr",&fzErr,"fzErr/D");
146  ftreeFit_->Branch("sigmaZErr",&fsigmaZErr,"fsigmaZErr/D");
147  ftreeFit_->Branch("dxdzErr",&fdxdzErr,"fdxdzErr/D");
148  ftreeFit_->Branch("dydzErr",&fdydzErr,"fdydzErr/D");
149  ftreeFit_->Branch("widthX",&fwidthX,"fwidthX/D");
150  ftreeFit_->Branch("widthY",&fwidthY,"fwidthY/D");
151  ftreeFit_->Branch("widthXErr",&fwidthXErr,"fwidthXErr/D");
152  ftreeFit_->Branch("widthYErr",&fwidthYErr,"fwidthYErr/D");
153  }
154 
155  fBSvector.clear();
156  ftotal_tracks = 0;
159  frun = flumi = -1;
161  fquality = falgo = true;
162  fpvValid = true;
163  fpvx = fpvy = fpvz = 0;
164  fitted_ = false;
165  resetRefTime();
166 
167  //debug histograms
168  h1ntrks = new TH1F("h1ntrks","number of tracks per event",50,0,50);
169  h1vz_event = new TH1F("h1vz_event","track Vz", 50, -30, 30 );
170  h1cutFlow = new TH1F("h1cutFlow","Cut flow table of track selection", 9, 0, 9);
171  h1cutFlow->GetXaxis()->SetBinLabel(1,"No cut");
172  h1cutFlow->GetXaxis()->SetBinLabel(2,"Traker hits");
173  h1cutFlow->GetXaxis()->SetBinLabel(3,"Pixel hits");
174  h1cutFlow->GetXaxis()->SetBinLabel(4,"norm. #chi^{2}");
175  h1cutFlow->GetXaxis()->SetBinLabel(5,"algo");
176  h1cutFlow->GetXaxis()->SetBinLabel(6,"quality");
177  h1cutFlow->GetXaxis()->SetBinLabel(7,"d_{0}");
178  h1cutFlow->GetXaxis()->SetBinLabel(8,"z_{0}");
179  h1cutFlow->GetXaxis()->SetBinLabel(9,"p_{T}");
180  resetCutFlow();
181 
182  // Primary vertex fitter
183  MyPVFitter = new PVFitter(iConfig, iColl);
184  MyPVFitter->resetAll();
185  if (savePVVertices_){
186  fPVTree_ = new TTree("PrimaryVertices","PrimaryVertices");
188  }
189 
190  // check filename
191  ffilename_changed = false;
192  if (writeDIPTxt_)
193  fasciiDIP.open(outputDIPTxt_.c_str());
194 }
EDGetTokenT< ProductType > consumes(edm::InputTag const &tag)
T getParameter(std::string const &) const
double trk_MaxZ_
Definition: BeamFitter.h:159
double trk_MaxEta_
Definition: BeamFitter.h:160
T getUntrackedParameter(std::string const &, T const &) const
double fwidthXErr
Definition: BeamFitter.h:243
double fwidthX
Definition: BeamFitter.h:241
std::vector< std::string > trk_Algorithm_
Definition: BeamFitter.h:165
void setTree(TTree *tree)
Definition: PVFitter.cc:198
int fendLumiOfFit
Definition: BeamFitter.h:226
double fwidthY
Definition: BeamFitter.h:242
bool isMuon_
Definition: BeamFitter.h:173
char fendTimeOfFit[32]
Definition: BeamFitter.h:228
double fdxdz
Definition: BeamFitter.h:233
double fx
Definition: BeamFitter.h:229
double fnormchi2
Definition: BeamFitter.h:193
bool ffilename_changed
Definition: BeamFitter.h:175
bool debug_
Definition: BeamFitter.h:148
int fnTOBLayerMeas
Definition: BeamFitter.h:205
std::vector< Track > TrackCollection
collection of Tracks
Definition: TrackFwd.h:10
double feta
Definition: BeamFitter.h:191
std::vector< std::string > trk_Quality_
Definition: BeamFitter.h:166
double convergence_
Definition: BeamFitter.h:170
double trk_MaxNormChi2_
Definition: BeamFitter.h:164
double fsigmaZErr
Definition: BeamFitter.h:238
TH1F * h1vz_event
Definition: BeamFitter.h:247
double fvy
Definition: BeamFitter.h:213
int fnPixelLayerMeas
Definition: BeamFitter.h:201
double fphi0
Definition: BeamFitter.h:194
std::ofstream fasciiDIP
Definition: BeamFitter.h:146
PVFitter * MyPVFitter
Definition: BeamFitter.h:251
std::vector< BSTrkParameters > fBSvector
Definition: BeamFitter.h:140
int fnTotLayerMeas
Definition: BeamFitter.h:200
std::string outputTxt_
Definition: BeamFitter.h:156
double fpvx
Definition: BeamFitter.h:219
double fdxdzErr
Definition: BeamFitter.h:239
double trk_MaxIP_
Definition: BeamFitter.h:161
TFile * file_
Definition: BeamFitter.h:187
TTree * ftree_
Definition: BeamFitter.h:188
double fyErr
Definition: BeamFitter.h:236
bool falgo
Definition: BeamFitter.h:217
int ftotal_tracks
Definition: BeamFitter.h:171
int min_Ntrks_
Definition: BeamFitter.h:172
TH1F * h1cutFlow
Definition: BeamFitter.h:248
double fdydz
Definition: BeamFitter.h:234
TTree * fPVTree_
Definition: BeamFitter.h:252
std::vector< reco::TrackBase::TrackAlgorithm > algorithm_
Definition: BeamFitter.h:168
TH1F * h1ntrks
Definition: BeamFitter.h:246
char fbeginTimeOfFit[32]
Definition: BeamFitter.h:227
double fpvz
Definition: BeamFitter.h:219
double fz0
Definition: BeamFitter.h:198
int j
Definition: DBlmapReader.cc:9
double ftheta
Definition: BeamFitter.h:189
double fd0
Definition: BeamFitter.h:195
bool fquality
Definition: BeamFitter.h:216
double fy
Definition: BeamFitter.h:230
int fnStripLayerMeas
Definition: BeamFitter.h:202
double fwidthYErr
Definition: BeamFitter.h:244
double fxErr
Definition: BeamFitter.h:235
bool appendRunTxt_
Definition: BeamFitter.h:149
int fnTIDLayerMeas
Definition: BeamFitter.h:204
bool saveNtuple_
Definition: BeamFitter.h:183
double fsigmaZ
Definition: BeamFitter.h:232
int fbeginLumiOfFit
Definition: BeamFitter.h:225
std::string outputfilename_
Definition: BeamFitter.h:186
bool writeTxt_
Definition: BeamFitter.h:153
double fsigmad0
Definition: BeamFitter.h:197
std::string outputDIPTxt_
Definition: BeamFitter.h:157
static TrackQuality qualityByName(const std::string &name)
Definition: TrackBase.cc:46
bool fpvValid
Definition: BeamFitter.h:218
double fdydzErr
Definition: BeamFitter.h:240
double inputBeamWidth_
Definition: BeamFitter.h:169
bool savePVVertices_
Definition: BeamFitter.h:185
void resetAll()
Definition: PVFitter.h:80
bool writeDIPTxt_
Definition: BeamFitter.h:154
double fvx
Definition: BeamFitter.h:212
double fpt
Definition: BeamFitter.h:190
double fcov[7][7]
Definition: BeamFitter.h:211
std::vector< reco::TrackBase::TrackQuality > quality_
Definition: BeamFitter.h:167
double fsigmaz0
Definition: BeamFitter.h:199
int trk_MinNPixLayers_
Definition: BeamFitter.h:163
int fnTIBLayerMeas
Definition: BeamFitter.h:203
TTree * ftreeFit_
Definition: BeamFitter.h:223
static TrackAlgorithm algoByName(const std::string &name)
Definition: TrackBase.cc:55
void resetCutFlow()
Definition: BeamFitter.h:105
double fd0bs
Definition: BeamFitter.h:196
edm::EDGetTokenT< reco::TrackCollection > tracksToken_
Definition: BeamFitter.h:150
double trk_MinpT_
Definition: BeamFitter.h:158
bool writeDIPBadFit_
Definition: BeamFitter.h:155
double fzErr
Definition: BeamFitter.h:237
int fnPXBLayerMeas
Definition: BeamFitter.h:207
double fpvy
Definition: BeamFitter.h:219
bool saveBeamFit_
Definition: BeamFitter.h:184
edm::EDGetTokenT< edm::View< reco::Vertex > > vertexToken_
Definition: BeamFitter.h:151
double fz
Definition: BeamFitter.h:231
bool fitted_
Definition: BeamFitter.h:174
edm::EDGetTokenT< reco::BeamSpot > beamSpotToken_
Definition: BeamFitter.h:152
int fnPXFLayerMeas
Definition: BeamFitter.h:208
int fnTECLayerMeas
Definition: BeamFitter.h:206
int trk_MinNTotLayers_
Definition: BeamFitter.h:162
void resetRefTime()
Definition: BeamFitter.h:56
BeamFitter::~BeamFitter ( )
virtual

Definition at line 196 of file BeamFitter.cc.

References file_, fitted_, fPVTree_, ftree_, ftreeFit_, h1cutFlow, h1ntrks, h1vz_event, h1z, MyPVFitter, saveBeamFit_, saveNtuple_, and savePVVertices_.

196  {
197 
198  if (saveNtuple_) {
199  file_->cd();
200  if (fitted_ && h1z) h1z->Write();
201  h1ntrks->Write();
202  h1vz_event->Write();
203  if (h1cutFlow) h1cutFlow->Write();
204  ftree_->Write();
205  }
206  if (saveBeamFit_){
207  file_->cd();
208  ftreeFit_->Write();
209  }
210  if (savePVVertices_){
211  file_->cd();
212  fPVTree_->Write();
213  }
214 
215 
217  file_->Close();
218  delete file_;
219  }
220  delete MyPVFitter;
221 }
TH1F * h1z
Definition: BeamFitter.h:182
TH1F * h1vz_event
Definition: BeamFitter.h:247
PVFitter * MyPVFitter
Definition: BeamFitter.h:251
TFile * file_
Definition: BeamFitter.h:187
TTree * ftree_
Definition: BeamFitter.h:188
TH1F * h1cutFlow
Definition: BeamFitter.h:248
TTree * fPVTree_
Definition: BeamFitter.h:252
TH1F * h1ntrks
Definition: BeamFitter.h:246
bool saveNtuple_
Definition: BeamFitter.h:183
bool savePVVertices_
Definition: BeamFitter.h:185
TTree * ftreeFit_
Definition: BeamFitter.h:223
bool saveBeamFit_
Definition: BeamFitter.h:184
bool fitted_
Definition: BeamFitter.h:174

Member Function Documentation

void BeamFitter::dumpBWTxtFile ( std::string &  fileName)

Definition at line 626 of file BeamFitter.cc.

References reco::BeamSpot::BeamWidthX(), reco::BeamSpot::BeamWidthXError(), fbeamWidthFit, and GetRecoTauVFromDQM_MC_cff::outFile.

Referenced by runBeamWidthFitter().

626  {
627  std::ofstream outFile;
628  outFile.open(fileName.c_str(),std::ios::app);
629  outFile<<"-------------------------------------------------------------------------------------------------------------------------------------------------------------"<<std::endl;
630  outFile<<"Beam width(in cm) from Log-likelihood fit (Here we assume a symmetric beam(SigmaX=SigmaY)!)"<<std::endl;
631  outFile<<" "<<std::endl;
632  outFile << "BeamWidth = " <<fbeamWidthFit.BeamWidthX() <<" +/- "<<fbeamWidthFit.BeamWidthXError() << std::endl;
633  outFile.close();
634 }
reco::BeamSpot fbeamWidthFit
Definition: BeamFitter.h:142
double BeamWidthX() const
beam width X
Definition: BeamSpot.h:86
double BeamWidthXError() const
error on beam width X, assume error in X = Y
Definition: BeamSpot.h:103
void BeamFitter::dumpTxtFile ( std::string &  fileName,
bool  append 
)

Definition at line 636 of file BeamFitter.cc.

References appendRunTxt_, reco::BeamSpot::BeamWidthX(), reco::BeamSpot::BeamWidthY(), reco::BeamSpot::betaStar(), reco::BeamSpot::covariance(), reco::BeamSpot::dxdz(), reco::BeamSpot::dydz(), reco::BeamSpot::emittanceX(), reco::BeamSpot::emittanceY(), fbeamspot, fbeginLumiOfFit, fbeginTimeOfFit, fbspotPVMap, fendLumiOfFit, fendTimeOfFit, ffilename_changed, ForDIPPV_, freftime, frun, i, getHLTprescales::index, PVFitter::IsFitPerBunchCrossing(), j, MyPVFitter, GetRecoTauVFromDQM_MC_cff::outFile, outputTxt_, reco::BeamSpot::sigmaZ(), AlCaHLTBitMon_QueryRunRegistry::string, reco::BeamSpot::type(), reco::BeamSpot::x0(), reco::BeamSpot::y0(), and reco::BeamSpot::z0().

Referenced by runFitter(), and runPVandTrkFitter().

636  {
637  std::ofstream outFile;
638 
639  std::string tmpname = outputTxt_;
640  char index[15];
641  if (appendRunTxt_ && !ffilename_changed ) {
642  sprintf(index,"%s%i","_Run", frun );
643  tmpname.insert(outputTxt_.length()-4,index);
644  fileName = tmpname;
645  ffilename_changed = true;
646  }
647 
648  if (!append)
649  outFile.open(fileName.c_str());
650  else
651  outFile.open(fileName.c_str(),std::ios::app);
652 
654 
655  for (std::map<int,reco::BeamSpot>::const_iterator abspot = fbspotPVMap.begin(); abspot!= fbspotPVMap.end(); ++abspot) {
656  reco::BeamSpot beamspottmp = abspot->second;
657  int bx = abspot->first;
658 
659  outFile << "Runnumber " << frun << " bx " << bx << std::endl;
660  outFile << "BeginTimeOfFit " << fbeginTimeOfFit << " " << freftime[0] << std::endl;
661  outFile << "EndTimeOfFit " << fendTimeOfFit << " " << freftime[1] << std::endl;
662  outFile << "LumiRange " << fbeginLumiOfFit << " - " << fendLumiOfFit << std::endl;
663  outFile << "Type " << beamspottmp.type() << std::endl;
664  outFile << "X0 " << beamspottmp.x0() << std::endl;
665  outFile << "Y0 " << beamspottmp.y0() << std::endl;
666  outFile << "Z0 " << beamspottmp.z0() << std::endl;
667  outFile << "sigmaZ0 " << beamspottmp.sigmaZ() << std::endl;
668  outFile << "dxdz " << beamspottmp.dxdz() << std::endl;
669  outFile << "dydz " << beamspottmp.dydz() << std::endl;
670  outFile << "BeamWidthX " << beamspottmp.BeamWidthX() << std::endl;
671  outFile << "BeamWidthY " << beamspottmp.BeamWidthY() << std::endl;
672  for (int i = 0; i<6; ++i) {
673  outFile << "Cov("<<i<<",j) ";
674  for (int j=0; j<7; ++j) {
675  outFile << beamspottmp.covariance(i,j) << " ";
676  }
677  outFile << std::endl;
678  }
679  outFile << "Cov(6,j) 0 0 0 0 0 0 " << beamspottmp.covariance(6,6) << std::endl;
680  //}
681  outFile << "EmittanceX " << beamspottmp.emittanceX() << std::endl;
682  outFile << "EmittanceY " << beamspottmp.emittanceY() << std::endl;
683  outFile << "BetaStar " << beamspottmp.betaStar() << std::endl;
684 
685  }
686  }//if bx results needed
687  else {
688  outFile << "Runnumber " << frun << std::endl;
689  outFile << "BeginTimeOfFit " << fbeginTimeOfFit << " " << freftime[0] << std::endl;
690  outFile << "EndTimeOfFit " << fendTimeOfFit << " " << freftime[1] << std::endl;
691  outFile << "LumiRange " << fbeginLumiOfFit << " - " << fendLumiOfFit << std::endl;
692  outFile << "Type " << fbeamspot.type() << std::endl;
693  outFile << "X0 " << fbeamspot.x0() << std::endl;
694  outFile << "Y0 " << fbeamspot.y0() << std::endl;
695  outFile << "Z0 " << fbeamspot.z0() << std::endl;
696  outFile << "sigmaZ0 " << fbeamspot.sigmaZ() << std::endl;
697  outFile << "dxdz " << fbeamspot.dxdz() << std::endl;
698  outFile << "dydz " << fbeamspot.dydz() << std::endl;
699  // if (inputBeamWidth_ > 0 ) {
700  // outFile << "BeamWidthX " << inputBeamWidth_ << std::endl;
701  // outFile << "BeamWidthY " << inputBeamWidth_ << std::endl;
702  // } else {
703  outFile << "BeamWidthX " << fbeamspot.BeamWidthX() << std::endl;
704  outFile << "BeamWidthY " << fbeamspot.BeamWidthY() << std::endl;
705  // }
706 
707  for (int i = 0; i<6; ++i) {
708  outFile << "Cov("<<i<<",j) ";
709  for (int j=0; j<7; ++j) {
710  outFile << fbeamspot.covariance(i,j) << " ";
711  }
712  outFile << std::endl;
713  }
714 
715  // beam width error
716  //if (inputBeamWidth_ > 0 ) {
717  // outFile << "Cov(6,j) 0 0 0 0 0 0 " << "1e-4" << std::endl;
718  //} else {
719  outFile << "Cov(6,j) 0 0 0 0 0 0 " << fbeamspot.covariance(6,6) << std::endl;
720  //}
721  outFile << "EmittanceX " << fbeamspot.emittanceX() << std::endl;
722  outFile << "EmittanceY " << fbeamspot.emittanceY() << std::endl;
723  outFile << "BetaStar " << fbeamspot.betaStar() << std::endl;
724 
725  //write here Pv info for DIP only: This added only if append is false, which happen for DIP only :)
726  if(!append){
727  outFile << "events "<< (int)ForDIPPV_[0] << std::endl;
728  outFile << "meanPV "<< ForDIPPV_[1] << std::endl;
729  outFile << "meanErrPV "<< ForDIPPV_[2] << std::endl;
730  outFile << "rmsPV "<< ForDIPPV_[3] << std::endl;
731  outFile << "rmsErrPV "<< ForDIPPV_[4] << std::endl;
732  outFile << "maxPV "<< (int)ForDIPPV_[5] << std::endl;
733  outFile << "nPV "<< (int)ForDIPPV_[6] << std::endl;
734  }//writeDIPPVInfo_
735  }//else end here
736 
737  outFile.close();
738 }
reco::BeamSpot fbeamspot
Definition: BeamFitter.h:141
double z0() const
z coordinate
Definition: BeamSpot.h:68
int i
Definition: DBlmapReader.cc:9
int fendLumiOfFit
Definition: BeamFitter.h:226
char fendTimeOfFit[32]
Definition: BeamFitter.h:228
bool ffilename_changed
Definition: BeamFitter.h:175
double emittanceX() const
additional information
Definition: BeamSpot.h:136
std::time_t freftime[2]
Definition: BeamFitter.h:220
PVFitter * MyPVFitter
Definition: BeamFitter.h:251
double betaStar() const
Definition: BeamSpot.h:138
double dydz() const
dydz slope
Definition: BeamSpot.h:84
std::string outputTxt_
Definition: BeamFitter.h:156
double emittanceY() const
Definition: BeamSpot.h:137
char fbeginTimeOfFit[32]
Definition: BeamFitter.h:227
int j
Definition: DBlmapReader.cc:9
double BeamWidthX() const
beam width X
Definition: BeamSpot.h:86
bool appendRunTxt_
Definition: BeamFitter.h:149
double dxdz() const
dxdz slope
Definition: BeamSpot.h:82
int fbeginLumiOfFit
Definition: BeamFitter.h:225
std::vector< float > ForDIPPV_
Definition: BeamFitter.h:178
double sigmaZ() const
sigma z
Definition: BeamSpot.h:80
double BeamWidthY() const
beam width Y
Definition: BeamSpot.h:88
std::map< int, reco::BeamSpot > fbspotPVMap
Definition: BeamFitter.h:143
double covariance(int i, int j) const
(i,j)-th element of error matrix
Definition: BeamSpot.h:112
double y0() const
y coordinate
Definition: BeamSpot.h:66
bool IsFitPerBunchCrossing()
Definition: PVFitter.h:93
BeamType type() const
return beam type
Definition: BeamSpot.h:129
double x0() const
x coordinate
Definition: BeamSpot.h:64
const char * BeamFitter::formatBTime ( const std::time_t &  t)
private

class: BeamFitter.cc package: RecoVertex/BeamSpotProducer

author: Francisco Yumiceva, Fermilab (yumic.nosp@m.eva@.nosp@m.fnal..nosp@m.gov) Geng-Yuan Jeng, UC Riverside (Geng-.nosp@m.Yuan.nosp@m..Jeng.nosp@m.@cer.nosp@m.n.ch)


Definition at line 30 of file BeamFitter.cc.

References plotBeamSpotDB::ptm.

Referenced by updateBTime().

30  {
31  struct std::tm * ptm;
32  ptm = gmtime(&t);
33  static char ts[] = "yyyy.mn.dd hh:mm:ss zzz ";
34  // This value should be taken directly from edm::Event::time(), which
35  // returns GMT (to be confirmed)
36  strftime(ts,sizeof(ts),"%Y.%m.%d %H:%M:%S GMT",ptm);
37  return ts;
38 }
reco::BeamSpot BeamFitter::getBeamSpot ( )
inline
std::map<int, reco::BeamSpot> BeamFitter::getBeamSpotMap ( )
inline

Definition at line 95 of file BeamFitter.h.

References fbspotPVMap.

Referenced by BeamMonitorBx::FitAndFill().

95 { return fbspotPVMap; }
std::map< int, reco::BeamSpot > fbspotPVMap
Definition: BeamFitter.h:143
reco::BeamSpot BeamFitter::getBeamWidth ( )
inline

Definition at line 51 of file BeamFitter.h.

References fbeamWidthFit.

Referenced by BeamSpotAnalyzer::endJob().

51 { return fbeamWidthFit; }
reco::BeamSpot fbeamWidthFit
Definition: BeamFitter.h:142
std::vector<BSTrkParameters> BeamFitter::getBSvector ( )
inline

Definition at line 96 of file BeamFitter.h.

References fBSvector.

Referenced by BeamSpotAnalyzer::endLuminosityBlock(), AlcaBeamSpotProducer::endLuminosityBlockProduce(), and BeamMonitor::FitAndFill().

96 { return fBSvector; }
std::vector< BSTrkParameters > fBSvector
Definition: BeamFitter.h:140
TH1F* BeamFitter::getCutFlow ( )
inline

Definition at line 97 of file BeamFitter.h.

References h1cutFlow.

Referenced by BeamMonitor::analyze(), and BeamMonitor::FitAndFill().

97 { return h1cutFlow; }
TH1F * h1cutFlow
Definition: BeamFitter.h:248
std::pair<int,int> BeamFitter::getFitLSRange ( )
inline
int BeamFitter::getNPVs ( )
inline

Definition at line 129 of file BeamFitter.h.

References PVFitter::getNPVs(), and MyPVFitter.

Referenced by BeamSpotAnalyzer::endLuminosityBlock().

129  {
130  return MyPVFitter->getNPVs();
131  }
PVFitter * MyPVFitter
Definition: BeamFitter.h:251
int getNPVs()
Definition: PVFitter.h:120
const std::map<int, int>& BeamFitter::getNPVsperBX ( )
inline

Definition at line 132 of file BeamFitter.h.

References PVFitter::getNPVsperBX(), and MyPVFitter.

Referenced by BeamMonitorBx::FitAndFill().

132  {
133  return MyPVFitter->getNPVsperBX();
134  }
const std::map< int, int > & getNPVsperBX()
Definition: PVFitter.h:122
PVFitter * MyPVFitter
Definition: BeamFitter.h:251
int BeamFitter::getNTracks ( )
inline

Definition at line 126 of file BeamFitter.h.

References fBSvector.

Referenced by BeamSpotAnalyzer::endLuminosityBlock().

126  {
127  return fBSvector.size();
128  }
std::vector< BSTrkParameters > fBSvector
Definition: BeamFitter.h:140
std::size_t BeamFitter::getPVvectorSize ( )
inline

Definition at line 72 of file BeamFitter.h.

References PVFitter::getpvStore(), MyPVFitter, and findQualityFiles::size.

Referenced by BeamMonitor::FitAndFill().

72 {return (MyPVFitter->getpvStore()).size(); }
PVFitter * MyPVFitter
Definition: BeamFitter.h:251
std::vector< BeamSpotFitPVData > getpvStore()
Definition: PVFitter.h:61
tuple size
Write out results.
std::pair<time_t,time_t> BeamFitter::getRefTime ( )
inline

Definition at line 65 of file BeamFitter.h.

References freftime.

Referenced by BeamMonitor::FitAndFill().

65  {
66  return std::make_pair(freftime[0], freftime[1]);
67  }
std::time_t freftime[2]
Definition: BeamFitter.h:220
int BeamFitter::getRunNumber ( )
inline

Definition at line 113 of file BeamFitter.h.

References frun.

Referenced by BeamMonitor::FitAndFill().

113  {
114  return frun;
115  }
void BeamFitter::readEvent ( const edm::Event iEvent)

Definition at line 224 of file BeamFitter.cc.

References funct::abs(), algorithm_, beamSpotToken_, countPass, debug_, falgo, fbeginLumiOfFit, fBSvector, fcharge, fcov, fd0, fd0bs, fendLumiOfFit, feta, spr::find(), flumi, fnormchi2, fnPixelLayerMeas, fnPXBLayerMeas, fnPXFLayerMeas, fnStripLayerMeas, fnTECLayerMeas, fnTIBLayerMeas, fnTIDLayerMeas, fnTOBLayerMeas, fnTotLayerMeas, fphi0, fpt, fpvValid, fpvx, fpvy, fpvz, fquality, freftime, frun, frunFit, fsigmad0, fsigmaz0, ftheta, ftotal_tracks, ftree_, fvx, fvy, fz0, edm::Event::getByToken(), h1cutFlow, h1ntrks, h1vz_event, i, edm::EventBase::id(), isMuon_, j, edm::EventBase::luminosityBlock(), MyPVFitter, reco::HitPattern::pixelBarrelLayersWithMeasurement(), reco::HitPattern::pixelEndcapLayersWithMeasurement(), reco::HitPattern::pixelLayersWithMeasurement(), reco::BeamSpot::position(), edm::Handle< T >::product(), quality_, PVFitter::readEvent(), edm::EventID::run(), saveNtuple_, BSTrkParameters::setVx(), BSTrkParameters::setVy(), edm::View< T >::size(), reco::HitPattern::stripLayersWithMeasurement(), reco::HitPattern::stripTECLayersWithMeasurement(), reco::HitPattern::stripTIBLayersWithMeasurement(), reco::HitPattern::stripTIDLayersWithMeasurement(), reco::HitPattern::stripTOBLayersWithMeasurement(), edm::EventBase::time(), reco::HitPattern::trackerLayersWithMeasurement(), testEve_cfg::tracks, tracksToken_, trk_MaxEta_, trk_MaxIP_, trk_MaxNormChi2_, trk_MaxZ_, trk_MinNPixLayers_, trk_MinNTotLayers_, trk_MinpT_, updateBTime(), edm::Timestamp::value(), and vertexToken_.

Referenced by BeamSpotAnalyzer::analyze(), AlcaBeamMonitor::analyze(), BeamMonitorBx::analyze(), BeamMonitor::analyze(), and AlcaBeamSpotProducer::produce().

225 {
226 
227 
228  frun = iEvent.id().run();
229  const edm::TimeValue_t ftimestamp = iEvent.time().value();
230  const std::time_t ftmptime = ftimestamp >> 32;
231 
232  if (fbeginLumiOfFit == -1) freftime[0] = freftime[1] = ftmptime;
233  if (freftime[0] == 0 || ftmptime < freftime[0]) freftime[0] = ftmptime;
234  if (freftime[1] == 0 || ftmptime > freftime[1]) freftime[1] = ftmptime;
235  // Update the human-readable string versions of the time
236  updateBTime();
237 
238  flumi = iEvent.luminosityBlock();
239  frunFit = frun;
242 
244  iEvent.getByToken(tracksToken_, TrackCollection);
245 
246  //------ Primary Vertices
248  bool hasPVs = false;
250  if ( iEvent.getByToken(vertexToken_, PVCollection ) ) {
251  pv = *PVCollection;
252  hasPVs = true;
253  }
254  //------
255 
256  //------ Beam Spot in current event
257  edm::Handle<reco::BeamSpot> recoBeamSpotHandle;
258  const reco::BeamSpot *refBS = 0;
259  if ( iEvent.getByToken(beamSpotToken_, recoBeamSpotHandle) )
260  refBS = recoBeamSpotHandle.product();
261  //-------
262 
263  const reco::TrackCollection *tracks = TrackCollection.product();
264 
265  double eventZ = 0;
266  double averageZ = 0;
267 
268  for ( reco::TrackCollection::const_iterator track = tracks->begin();
269  track != tracks->end();
270  ++track ) {
271 
272  if ( ! isMuon_) {
273 
274  const reco::HitPattern& trkHP = track->hitPattern();
275 
285  } else {
286 
287  fnTotLayerMeas = track->numberOfValidHits();
288 
289  }
290 
291  fpt = track->pt();
292  feta = track->eta();
293  fphi0 = track->phi();
294  fcharge = track->charge();
295  fnormchi2 = track->normalizedChi2();
296  fd0 = track->d0();
297  if (refBS) fd0bs = -1*track->dxy(refBS->position());
298  else fd0bs = 0.;
299 
300  fsigmad0 = track->d0Error();
301  fz0 = track->dz();
302  fsigmaz0 = track->dzError();
303  ftheta = track->theta();
304  fvx = track->vx();
305  fvy = track->vy();
306 
307  for (int i=0; i<5; ++i) {
308  for (int j=0; j<5; ++j) {
309  fcov[i][j] = track->covariance(i,j);
310  }
311  }
312 
313  fquality = true;
314  falgo = true;
315 
316  if (! isMuon_ ) {
317  if (quality_.size()!=0) {
318  fquality = false;
319  for (unsigned int i = 0; i<quality_.size();++i) {
320  if(debug_) edm::LogInfo("BeamFitter") << "quality_[" << i << "] = " << track->qualityName(quality_[i]) << std::endl;
321  if (track->quality(quality_[i])) {
322  fquality = true;
323  break;
324  }
325  }
326  }
327 
328 
329  // Track algorithm
330 
331  if (algorithm_.size()!=0) {
332  if (std::find(algorithm_.begin(),algorithm_.end(),track->algo())==algorithm_.end())
333  falgo = false;
334  }
335 
336  }
337 
338  // check if we have a valid PV
339  fpvValid = false;
340 
341  if ( hasPVs ) {
342 
343  for ( size_t ipv=0; ipv != pv.size(); ++ipv ) {
344 
345  if (! pv[ipv].isFake() ) fpvValid = true;
346 
347  if ( ipv==0 && !pv[0].isFake() ) { fpvx = pv[0].x(); fpvy = pv[0].y(); fpvz = pv[0].z(); } // fix this later
348 
349 
350  }
351 
352  }
353 
354 
355  if (saveNtuple_) ftree_->Fill();
356  ftotal_tracks++;
357 
359  // Track selection
360  if (fnTotLayerMeas >= trk_MinNTotLayers_) { countPass[1] += 1;
362  if (fnormchi2 < trk_MaxNormChi2_) { countPass[3] += 1;
363  if (falgo) {countPass[4] += 1;
364  if (fquality) { countPass[5] += 1;
365  if (std::abs( fd0 ) < trk_MaxIP_) { countPass[6] += 1;
366  if (std::abs( fz0 ) < trk_MaxZ_){ countPass[7] += 1;
367  if (fpt > trk_MinpT_) {
368  countPass[8] += 1;
369  if (std::abs( feta ) < trk_MaxEta_
370  //&& fpvValid
371  ) {
372  if (debug_) {
373  edm::LogInfo("BeamFitter") << "Selected track quality = " << track->qualityMask()
374  << "; track algorithm = " << track->algoName() << "= TrackAlgorithm: " << track->algo() << std::endl;
375  }
377  BSTrk.setVx(fvx);
378  BSTrk.setVy(fvy);
379  fBSvector.push_back(BSTrk);
380  averageZ += fz0;
381  }
382  }
383  }
384  }
385  }
386  }
387  }
388  }
389  }// track selection
390 
391  }// tracks
392 
393  averageZ = averageZ/(float)(fBSvector.size());
394 
395  for( std::vector<BSTrkParameters>::const_iterator iparam = fBSvector.begin(); iparam != fBSvector.end(); ++iparam) {
396 
397  eventZ += fabs( iparam->z0() - averageZ );
398 
399  }
400 
401  h1ntrks->Fill( fBSvector.size() );
402  h1vz_event->Fill( eventZ/(float)(fBSvector.size() ) ) ;
403  for (unsigned int i=0; i < sizeof(countPass)/sizeof(countPass[0]); i++)
404  h1cutFlow->SetBinContent(i+1,countPass[i]);
405 
406  MyPVFitter->readEvent(iEvent);
407 
408 }
RunNumber_t run() const
Definition: EventID.h:42
int stripTOBLayersWithMeasurement() const
Definition: HitPattern.cc:376
double trk_MaxZ_
Definition: BeamFitter.h:159
double trk_MaxEta_
Definition: BeamFitter.h:160
int i
Definition: DBlmapReader.cc:9
int fendLumiOfFit
Definition: BeamFitter.h:226
int countPass[9]
Definition: BeamFitter.h:249
bool isMuon_
Definition: BeamFitter.h:173
int stripTIBLayersWithMeasurement() const
Definition: HitPattern.cc:358
bool getByToken(EDGetToken token, Handle< PROD > &result) const
Definition: Event.h:434
double fnormchi2
Definition: BeamFitter.h:193
bool debug_
Definition: BeamFitter.h:148
int fnTOBLayerMeas
Definition: BeamFitter.h:205
std::vector< Track > TrackCollection
collection of Tracks
Definition: TrackFwd.h:10
double feta
Definition: BeamFitter.h:191
int pixelLayersWithMeasurement() const
Definition: HitPattern.h:738
double trk_MaxNormChi2_
Definition: BeamFitter.h:164
edm::LuminosityBlockNumber_t luminosityBlock() const
Definition: EventBase.h:59
TH1F * h1vz_event
Definition: BeamFitter.h:247
double fvy
Definition: BeamFitter.h:213
void find(edm::Handle< EcalRecHitCollection > &hits, DetId thisDet, std::vector< EcalRecHitCollection::const_iterator > &hit, bool debug=false)
Definition: FindCaloHit.cc:7
int fnPixelLayerMeas
Definition: BeamFitter.h:201
int pixelEndcapLayersWithMeasurement() const
Definition: HitPattern.cc:348
double fphi0
Definition: BeamFitter.h:194
std::time_t freftime[2]
Definition: BeamFitter.h:220
PVFitter * MyPVFitter
Definition: BeamFitter.h:251
std::vector< BSTrkParameters > fBSvector
Definition: BeamFitter.h:140
int fnTotLayerMeas
Definition: BeamFitter.h:200
double fpvx
Definition: BeamFitter.h:219
double trk_MaxIP_
Definition: BeamFitter.h:161
void readEvent(const edm::Event &iEvent)
Definition: PVFitter.cc:101
TTree * ftree_
Definition: BeamFitter.h:188
bool falgo
Definition: BeamFitter.h:217
int ftotal_tracks
Definition: BeamFitter.h:171
int stripTIDLayersWithMeasurement() const
Definition: HitPattern.cc:367
int trackerLayersWithMeasurement() const
Definition: HitPattern.h:733
TH1F * h1cutFlow
Definition: BeamFitter.h:248
std::vector< reco::TrackBase::TrackAlgorithm > algorithm_
Definition: BeamFitter.h:168
TH1F * h1ntrks
Definition: BeamFitter.h:246
double fpvz
Definition: BeamFitter.h:219
double fz0
Definition: BeamFitter.h:198
Abs< T >::type abs(const T &t)
Definition: Abs.h:22
int j
Definition: DBlmapReader.cc:9
double ftheta
Definition: BeamFitter.h:189
double fd0
Definition: BeamFitter.h:195
bool fquality
Definition: BeamFitter.h:216
int fnStripLayerMeas
Definition: BeamFitter.h:202
unsigned long long TimeValue_t
Definition: Timestamp.h:28
int fnTIDLayerMeas
Definition: BeamFitter.h:204
bool saveNtuple_
Definition: BeamFitter.h:183
int fbeginLumiOfFit
Definition: BeamFitter.h:225
double fsigmad0
Definition: BeamFitter.h:197
bool fpvValid
Definition: BeamFitter.h:218
tuple tracks
Definition: testEve_cfg.py:39
void updateBTime()
Definition: BeamFitter.cc:40
int stripLayersWithMeasurement() const
Definition: HitPattern.h:743
int pixelBarrelLayersWithMeasurement() const
Definition: HitPattern.cc:338
size_type size() const
double fvx
Definition: BeamFitter.h:212
T const * product() const
Definition: Handle.h:81
double fpt
Definition: BeamFitter.h:190
edm::EventID id() const
Definition: EventBase.h:56
double fcov[7][7]
Definition: BeamFitter.h:211
std::vector< reco::TrackBase::TrackQuality > quality_
Definition: BeamFitter.h:167
double fsigmaz0
Definition: BeamFitter.h:199
int trk_MinNPixLayers_
Definition: BeamFitter.h:163
int fnTIBLayerMeas
Definition: BeamFitter.h:203
int stripTECLayersWithMeasurement() const
Definition: HitPattern.cc:385
double fd0bs
Definition: BeamFitter.h:196
const Point & position() const
position
Definition: BeamSpot.h:62
edm::EDGetTokenT< reco::TrackCollection > tracksToken_
Definition: BeamFitter.h:150
double trk_MinpT_
Definition: BeamFitter.h:158
int fnPXBLayerMeas
Definition: BeamFitter.h:207
TimeValue_t value() const
Definition: Timestamp.h:56
edm::Timestamp time() const
Definition: EventBase.h:57
double fpvy
Definition: BeamFitter.h:219
edm::EDGetTokenT< edm::View< reco::Vertex > > vertexToken_
Definition: BeamFitter.h:151
edm::EDGetTokenT< reco::BeamSpot > beamSpotToken_
Definition: BeamFitter.h:152
int fnPXFLayerMeas
Definition: BeamFitter.h:208
int fnTECLayerMeas
Definition: BeamFitter.h:206
int trk_MinNTotLayers_
Definition: BeamFitter.h:162
void BeamFitter::resetCutFlow ( )
inline
void BeamFitter::resetLSRange ( )
inline
void BeamFitter::resetPVFitter ( )
inline
void BeamFitter::resetRefTime ( )
inline
void BeamFitter::resetTotTrk ( )
inline

Definition at line 54 of file BeamFitter.h.

References ftotal_tracks.

54 { ftotal_tracks=0; }
int ftotal_tracks
Definition: BeamFitter.h:171
void BeamFitter::resetTrkVector ( )
inline
void BeamFitter::resizeBSvector ( unsigned int  nsize)
inline

Definition at line 74 of file BeamFitter.h.

References fBSvector.

Referenced by BeamMonitor::FitAndFill().

74  {
75  fBSvector.erase(fBSvector.begin(),fBSvector.begin()+nsize);
76  }
std::vector< BSTrkParameters > fBSvector
Definition: BeamFitter.h:140
void BeamFitter::resizePVvector ( unsigned int  npvsize)
inline

Definition at line 79 of file BeamFitter.h.

References MyPVFitter, and PVFitter::resizepvStore().

Referenced by BeamMonitor::FitAndFill().

79  {
80  MyPVFitter->resizepvStore(npvsize);
81  }
PVFitter * MyPVFitter
Definition: BeamFitter.h:251
void resizepvStore(unsigned int rmSize)
Definition: PVFitter.h:109
void BeamFitter::runAllFitter ( )

Definition at line 780 of file BeamFitter.cc.

References gather_cfg::cout, debug_, fbeamspot, fBSvector, BSFitter::Fit(), BSFitter::Fit_d0phi(), BSFitter::Fit_ited0phi(), BSFitter::Setd0Cut_d0phi(), BSFitter::SetFitType(), BSFitter::SetFitVariable(), and AlCaHLTBitMon_QueryRunRegistry::string.

Referenced by BeamSpotAnalyzer::endJob().

780  {
781  if(fBSvector.size()!=0){
782  BSFitter *myalgo = new BSFitter( fBSvector );
783  fbeamspot = myalgo->Fit_d0phi();
784 
785  // iterative
786  if(debug_)
787  std::cout << " d0-phi Iterative:" << std::endl;
788  BSFitter *myitealgo = new BSFitter( fBSvector );
789  myitealgo->Setd0Cut_d0phi(4.0);
790  reco::BeamSpot beam_ite = myitealgo->Fit_ited0phi();
791  if (debug_){
792  std::cout << beam_ite << std::endl;
793  std::cout << "\n Now run tests of the different fits\n";
794  }
795  // from here are just tests
796  std::string fit_type = "chi2";
797  myalgo->SetFitVariable(std::string("z"));
798  myalgo->SetFitType(std::string("chi2"));
799  reco::BeamSpot beam_fit_z_chi2 = myalgo->Fit();
800  if (debug_){
801  std::cout << " z Chi2 Fit ONLY:" << std::endl;
802  std::cout << beam_fit_z_chi2 << std::endl;
803  }
804 
805  fit_type = "combined";
806  myalgo->SetFitVariable("z");
807  myalgo->SetFitType("combined");
808  reco::BeamSpot beam_fit_z_lh = myalgo->Fit();
809  if (debug_){
810  std::cout << " z Log-Likelihood Fit ONLY:" << std::endl;
811  std::cout << beam_fit_z_lh << std::endl;
812  }
813 
814  myalgo->SetFitVariable("d");
815  myalgo->SetFitType("d0phi");
816  reco::BeamSpot beam_fit_dphi = myalgo->Fit();
817  if (debug_){
818  std::cout << " d0-phi0 Fit ONLY:" << std::endl;
819  std::cout << beam_fit_dphi << std::endl;
820  }
821  /*
822  myalgo->SetFitVariable(std::string("d*z"));
823  myalgo->SetFitType(std::string("likelihood"));
824  reco::BeamSpot beam_fit_dz_lh = myalgo->Fit();
825  if (debug_){
826  std::cout << " Log-Likelihood Fit:" << std::endl;
827  std::cout << beam_fit_dz_lh << std::endl;
828  }
829 
830  myalgo->SetFitVariable(std::string("d*z"));
831  myalgo->SetFitType(std::string("resolution"));
832  reco::BeamSpot beam_fit_dresz_lh = myalgo->Fit();
833  if(debug_){
834  std::cout << " IP Resolution Fit" << std::endl;
835  std::cout << beam_fit_dresz_lh << std::endl;
836 
837  std::cout << "c0 = " << myalgo->GetResPar0() << " +- " << myalgo->GetResPar0Err() << std::endl;
838  std::cout << "c1 = " << myalgo->GetResPar1() << " +- " << myalgo->GetResPar1Err() << std::endl;
839  }
840  */
841  }
842  else
843  if (debug_) std::cout << "No good track selected! No beam fit!" << std::endl;
844 }
reco::BeamSpot fbeamspot
Definition: BeamFitter.h:141
reco::BeamSpot Fit()
Definition: BSFitter.cc:100
bool debug_
Definition: BeamFitter.h:148
std::vector< BSTrkParameters > fBSvector
Definition: BeamFitter.h:140
reco::BeamSpot Fit_ited0phi()
Definition: BSFitter.cc:391
void SetFitVariable(std::string name)
Definition: BSFitter.h:45
void Setd0Cut_d0phi(double d0cut)
Definition: BSFitter.cc:623
tuple cout
Definition: gather_cfg.py:121
reco::BeamSpot Fit_d0phi()
Definition: BSFitter.cc:447
void SetFitType(std::string type)
Definition: BSFitter.h:41
bool BeamFitter::runBeamWidthFitter ( )

Definition at line 591 of file BeamFitter.cc.

References convergence_, dumpBWTxtFile(), reco::BeamSpot::Fake, fbeamspot, fbeamWidthFit, fBSvector, BSFitter::Fit(), ftotal_tracks, inputBeamWidth_, min_Ntrks_, outputTxt_, BSFitter::SetConvergence(), BSFitter::SetFitType(), BSFitter::SetFitVariable(), BSFitter::SetInputBeamWidth(), BSFitter::SetMaximumZ(), BSFitter::SetMinimumNTrks(), reco::BeamSpot::setType(), AlCaHLTBitMon_QueryRunRegistry::string, trk_MaxZ_, reco::BeamSpot::type(), and writeTxt_.

Referenced by BeamSpotAnalyzer::endJob().

591  {
592  bool widthfit_ok = false;
593  // default fit to extract beam spot info
594  if(fBSvector.size() > 1 ){
595 
596  edm::LogInfo("BeamFitter") << "Calculating beam spot positions('d0-phi0' method) and width using llh Fit"<< std::endl
597  << "We will use " << fBSvector.size() << " good tracks out of " << ftotal_tracks << std::endl;
598 
599  BSFitter *myalgo = new BSFitter( fBSvector );
600  myalgo->SetMaximumZ( trk_MaxZ_ );
601  myalgo->SetConvergence( convergence_ );
602  myalgo->SetMinimumNTrks(min_Ntrks_);
604 
605 
606  myalgo->SetFitVariable(std::string("d*z"));
607  myalgo->SetFitType(std::string("likelihood"));
608  fbeamWidthFit = myalgo->Fit();
609 
610  //Add to .txt file
612 
613  delete myalgo;
614 
615  // not fake
616  if ( fbeamspot.type() != 0 )
617  widthfit_ok = true;
618  }
619  else{
621  edm::LogWarning("BeamFitter") << "Not enough good tracks selected! No beam fit!" << std::endl;
622  }
623  return widthfit_ok;
624 }
double trk_MaxZ_
Definition: BeamFitter.h:159
reco::BeamSpot fbeamspot
Definition: BeamFitter.h:141
reco::BeamSpot Fit()
Definition: BSFitter.cc:100
void SetMaximumZ(double z)
Definition: BSFitter.h:61
double convergence_
Definition: BeamFitter.h:170
void dumpBWTxtFile(std::string &)
Definition: BeamFitter.cc:626
void SetInputBeamWidth(double val)
Definition: BSFitter.h:66
void setType(BeamType type)
set beam type
Definition: BeamSpot.h:131
reco::BeamSpot fbeamWidthFit
Definition: BeamFitter.h:142
std::vector< BSTrkParameters > fBSvector
Definition: BeamFitter.h:140
std::string outputTxt_
Definition: BeamFitter.h:156
int ftotal_tracks
Definition: BeamFitter.h:171
int min_Ntrks_
Definition: BeamFitter.h:172
bool writeTxt_
Definition: BeamFitter.h:153
double inputBeamWidth_
Definition: BeamFitter.h:169
void SetFitVariable(std::string name)
Definition: BSFitter.h:45
void SetMinimumNTrks(int n)
Definition: BSFitter.h:63
void SetConvergence(double val)
Definition: BSFitter.h:62
BeamType type() const
return beam type
Definition: BeamSpot.h:129
void SetFitType(std::string type)
Definition: BSFitter.h:41
bool BeamFitter::runFitter ( )

Definition at line 580 of file BeamFitter.cc.

References dumpTxtFile(), outputDIPTxt_, outputTxt_, runFitterNoTxt(), writeDIPBadFit_, writeDIPTxt_, and writeTxt_.

580  {
581 
582  bool fit_ok = runFitterNoTxt();
583 
584  if(writeTxt_ ) dumpTxtFile(outputTxt_,true); // all reaults
585  if(writeDIPTxt_ && (fit_ok || writeDIPBadFit_)) {
586  dumpTxtFile(outputDIPTxt_,false); // for DQM/DIP
587  }
588  return fit_ok;
589 }
std::string outputTxt_
Definition: BeamFitter.h:156
bool runFitterNoTxt()
Definition: BeamFitter.cc:512
bool writeTxt_
Definition: BeamFitter.h:153
std::string outputDIPTxt_
Definition: BeamFitter.h:157
void dumpTxtFile(std::string &, bool)
Definition: BeamFitter.cc:636
bool writeDIPTxt_
Definition: BeamFitter.h:154
bool writeDIPBadFit_
Definition: BeamFitter.h:155
bool BeamFitter::runFitterNoTxt ( )

Definition at line 512 of file BeamFitter.cc.

References reco::BeamSpot::BeamWidthX(), reco::BeamSpot::BeamWidthXError(), reco::BeamSpot::BeamWidthY(), reco::BeamSpot::BeamWidthYError(), convergence_, reco::BeamSpot::dxdz(), reco::BeamSpot::dxdzError(), reco::BeamSpot::dydz(), reco::BeamSpot::dydzError(), reco::BeamSpot::Fake, fbeamspot, fbeginLumiOfFit, fbeginTimeOfFit, fBSvector, fdxdz, fdxdzErr, fdydz, fdydzErr, fendLumiOfFit, fendTimeOfFit, BSFitter::Fit(), fitted_, freftime, fsigmaZ, fsigmaZErr, ftotal_tracks, ftreeFit_, fwidthX, fwidthXErr, fwidthY, fwidthYErr, fx, fxErr, fy, fyErr, fz, fzErr, BSFitter::GetVzHisto(), h1z, inputBeamWidth_, min_Ntrks_, saveBeamFit_, BSFitter::SetConvergence(), BSFitter::SetInputBeamWidth(), BSFitter::SetMaximumZ(), BSFitter::SetMinimumNTrks(), reco::BeamSpot::setType(), reco::BeamSpot::sigmaZ(), reco::BeamSpot::sigmaZ0Error(), trk_MaxZ_, reco::BeamSpot::type(), reco::BeamSpot::x0(), reco::BeamSpot::x0Error(), reco::BeamSpot::y0(), reco::BeamSpot::y0Error(), reco::BeamSpot::z0(), and reco::BeamSpot::z0Error().

Referenced by runFitter(), and runPVandTrkFitter().

512  {
513  edm::LogInfo("BeamFitter") << " [BeamFitterDebugTime] freftime[0] = " << freftime[0]
514  << "; address = " << &freftime[0]
515  << " = " << fbeginTimeOfFit << std::endl;
516  edm::LogInfo("BeamFitter") << " [BeamFitterDebugTime] freftime[1] = " << freftime[1]
517  << "; address = " << &freftime[1]
518  << " = " << fendTimeOfFit << std::endl;
519 
520  if (fbeginLumiOfFit == -1 || fendLumiOfFit == -1) {
521  edm::LogWarning("BeamFitter") << "No event read! No Fitting!" << std::endl;
522  return false;
523  }
524 
525  bool fit_ok = false;
526  // default fit to extract beam spot info
527  if(fBSvector.size() > 1 ){
528 
529  edm::LogInfo("BeamFitter") << "Calculating beam spot..." << std::endl
530  << "We will use " << fBSvector.size() << " good tracks out of " << ftotal_tracks << std::endl;
531 
532  BSFitter *myalgo = new BSFitter( fBSvector );
533  myalgo->SetMaximumZ( trk_MaxZ_ );
534  myalgo->SetConvergence( convergence_ );
535  myalgo->SetMinimumNTrks( min_Ntrks_ );
537 
538  fbeamspot = myalgo->Fit();
539 
540 
541  // retrieve histogram for Vz
542  h1z = (TH1F*) myalgo->GetVzHisto();
543 
544  delete myalgo;
545  if ( fbeamspot.type() != 0 ) {// save all results except for Fake (all 0.)
546  fit_ok = true;
547  if (saveBeamFit_){
548  fx = fbeamspot.x0();
549  fy = fbeamspot.y0();
550  fz = fbeamspot.z0();
552  fdxdz = fbeamspot.dxdz();
553  fdydz = fbeamspot.dydz();
556  fxErr = fbeamspot.x0Error();
557  fyErr = fbeamspot.y0Error();
558  fzErr = fbeamspot.z0Error();
564  ftreeFit_->Fill();
565  }
566  }
567  }
568  else{ // tracks <= 1
569  reco::BeamSpot tmpbs;
570  fbeamspot = tmpbs;
572  edm::LogInfo("BeamFitter") << "Not enough good tracks selected! No beam fit!" << std::endl;
573 
574  }
575  fitted_ = true;
576  return fit_ok;
577 
578 }
double trk_MaxZ_
Definition: BeamFitter.h:159
reco::BeamSpot fbeamspot
Definition: BeamFitter.h:141
double z0() const
z coordinate
Definition: BeamSpot.h:68
double fwidthXErr
Definition: BeamFitter.h:243
double fwidthX
Definition: BeamFitter.h:241
double sigmaZ0Error() const
error on sigma z
Definition: BeamSpot.h:96
int fendLumiOfFit
Definition: BeamFitter.h:226
double fwidthY
Definition: BeamFitter.h:242
reco::BeamSpot Fit()
Definition: BSFitter.cc:100
char fendTimeOfFit[32]
Definition: BeamFitter.h:228
double dydzError() const
error on dydz
Definition: BeamSpot.h:100
double fdxdz
Definition: BeamFitter.h:233
double fx
Definition: BeamFitter.h:229
TH1F * h1z
Definition: BeamFitter.h:182
void SetMaximumZ(double z)
Definition: BSFitter.h:61
double convergence_
Definition: BeamFitter.h:170
double fsigmaZErr
Definition: BeamFitter.h:238
void SetInputBeamWidth(double val)
Definition: BSFitter.h:66
void setType(BeamType type)
set beam type
Definition: BeamSpot.h:131
std::time_t freftime[2]
Definition: BeamFitter.h:220
std::vector< BSTrkParameters > fBSvector
Definition: BeamFitter.h:140
double dydz() const
dydz slope
Definition: BeamSpot.h:84
double fdxdzErr
Definition: BeamFitter.h:239
double dxdzError() const
error on dxdz
Definition: BeamSpot.h:98
double fyErr
Definition: BeamFitter.h:236
int ftotal_tracks
Definition: BeamFitter.h:171
int min_Ntrks_
Definition: BeamFitter.h:172
double fdydz
Definition: BeamFitter.h:234
char fbeginTimeOfFit[32]
Definition: BeamFitter.h:227
double BeamWidthX() const
beam width X
Definition: BeamSpot.h:86
double fy
Definition: BeamFitter.h:230
double BeamWidthYError() const
error on beam width Y, assume error in X = Y
Definition: BeamSpot.h:105
double BeamWidthXError() const
error on beam width X, assume error in X = Y
Definition: BeamSpot.h:103
double z0Error() const
error on z
Definition: BeamSpot.h:94
double fwidthYErr
Definition: BeamFitter.h:244
double fxErr
Definition: BeamFitter.h:235
double dxdz() const
dxdz slope
Definition: BeamSpot.h:82
double x0Error() const
error on x
Definition: BeamSpot.h:90
double y0Error() const
error on y
Definition: BeamSpot.h:92
double fsigmaZ
Definition: BeamFitter.h:232
int fbeginLumiOfFit
Definition: BeamFitter.h:225
double fdydzErr
Definition: BeamFitter.h:240
double inputBeamWidth_
Definition: BeamFitter.h:169
double sigmaZ() const
sigma z
Definition: BeamSpot.h:80
double BeamWidthY() const
beam width Y
Definition: BeamSpot.h:88
void SetMinimumNTrks(int n)
Definition: BSFitter.h:63
TH1F * GetVzHisto()
Definition: BSFitter.h:105
TTree * ftreeFit_
Definition: BeamFitter.h:223
double y0() const
y coordinate
Definition: BeamSpot.h:66
void SetConvergence(double val)
Definition: BSFitter.h:62
double fzErr
Definition: BeamFitter.h:237
bool saveBeamFit_
Definition: BeamFitter.h:184
double fz
Definition: BeamFitter.h:231
bool fitted_
Definition: BeamFitter.h:174
BeamType type() const
return beam type
Definition: BeamSpot.h:129
double x0() const
x coordinate
Definition: BeamSpot.h:64
bool BeamFitter::runPVandTrkFitter ( )

Definition at line 410 of file BeamFitter.cc.

References reco::BeamSpot::BeamWidthX(), reco::BeamSpot::BeamWidthY(), reco::BeamSpot::covariance(), dumpTxtFile(), reco::BeamSpot::dxdz(), reco::BeamSpot::dydz(), reco::BeamSpot::Fake, fbeamspot, fbeginTimeOfFit, fbspotPVMap, fendTimeOfFit, ForDIPPV_, freftime, PVFitter::getBeamSpot(), PVFitter::getBeamSpotMap(), PVFitter::getWidthXerr(), i, inputBeamWidth_, PVFitter::IsFitPerBunchCrossing(), j, gen::k, makeMuonMisalignmentScenario::matrix, MyPVFitter, outputDIPTxt_, outputTxt_, funct::pow(), PVFitter::runBXFitter(), PVFitter::runFitter(), runFitterNoTxt(), reco::BeamSpot::setBeamWidthY(), reco::BeamSpot::setType(), reco::BeamSpot::sigmaZ(), mathSSE::sqrt(), reco::BeamSpot::type(), reco::BeamSpot::Unknown, writeDIPBadFit_, writeDIPTxt_, writeTxt_, reco::BeamSpot::x0(), reco::BeamSpot::y0(), and reco::BeamSpot::z0().

Referenced by BeamSpotAnalyzer::endJob(), BeamSpotAnalyzer::endLuminosityBlock(), AlcaBeamMonitor::endLuminosityBlock(), AlcaBeamSpotProducer::endLuminosityBlockProduce(), BeamMonitorBx::FitAndFill(), and BeamMonitor::FitAndFill().

410  {
411 // run both PV and track fitters
412  bool fit_ok = false;
413  bool pv_fit_ok = false;
414  reco::BeamSpot bspotPV;
415  reco::BeamSpot bspotTrk;
416 
417  // First run PV fitter
419  edm::LogInfo("BeamFitter") << " [BeamFitterBxDebugTime] freftime[0] = " << freftime[0]
420  << "; address = " << &freftime[0]
421  << " = " << fbeginTimeOfFit << std::endl;
422  edm::LogInfo("BeamFitter") << " [BeamFitterBxDebugTime] freftime[1] = " << freftime[1]
423  << "; address = " << &freftime[1]
424  << " = " << fendTimeOfFit << std::endl;
425 
426  if ( MyPVFitter->runBXFitter() ) {
428  pv_fit_ok = true;
429  }
430  if(writeTxt_ ) dumpTxtFile(outputTxt_,true); // all reaults
431  if(writeDIPTxt_ && (pv_fit_ok || writeDIPBadFit_)) {
432  dumpTxtFile(outputDIPTxt_,false); // for DQM/DIP
433  }
434  return pv_fit_ok;
435  }
436 
437  if ( MyPVFitter->runFitter() ) {
438 
439  bspotPV = MyPVFitter->getBeamSpot();
440 
441  // take beam width from PV fit and pass it to track fitter
442  // assume circular transverse beam width
443  inputBeamWidth_ = sqrt( pow(bspotPV.BeamWidthX(),2) + pow(bspotPV.BeamWidthY(),2) )/sqrt(2);
444  pv_fit_ok = true;
445 
446  } else {
447  // problems with PV fit
449  bspotTrk.setType(reco::BeamSpot::Unknown); //propagate error to trk beam spot
450  }
451 
452  if ( runFitterNoTxt() ) {
453 
454  bspotTrk = fbeamspot;
455  fit_ok = true;
456  } else {
457  // beamfit failed, flagged as empty beam spot
458  bspotTrk.setType(reco::BeamSpot::Fake);
459  fit_ok = false;
460  }
461 
462  // combined results into one single beam spot
463 
464  // to pass errors I have to create another beam spot object
466  for (int j = 0 ; j < 7 ; ++j) {
467  for(int k = j ; k < 7 ; ++k) {
468  matrix(j,k) = bspotTrk.covariance(j,k);
469  }
470  }
471  // change beam width error to one from PV
472  if (pv_fit_ok && fit_ok ) {
474 
475  // get Z and sigmaZ from PV fit
476  matrix(2,2) = bspotPV.covariance(2,2);
477  matrix(3,3) = bspotPV.covariance(3,3);
478  reco::BeamSpot tmpbs(reco::BeamSpot::Point(bspotTrk.x0(), bspotTrk.y0(),
479  bspotPV.z0() ),
480  bspotPV.sigmaZ() ,
481  bspotTrk.dxdz(),
482  bspotTrk.dydz(),
483  bspotPV.BeamWidthX(),
484  matrix,
485  bspotPV.type() );
486  tmpbs.setBeamWidthY( bspotPV.BeamWidthY() );
487  // overwrite beam spot result
488  fbeamspot = tmpbs;
489  }
490  if (pv_fit_ok && fit_ok) {
491  fbeamspot.setType(bspotPV.type());
492  }
493  else if(!pv_fit_ok && fit_ok){
495  }
496  else if(pv_fit_ok && !fit_ok){
498  }
499  else if(!pv_fit_ok && !fit_ok){
501  }
502 
503  if(writeTxt_ ) dumpTxtFile(outputTxt_,true); // all reaults
504  if(writeDIPTxt_ && ((fit_ok && pv_fit_ok) || writeDIPBadFit_)) {
505  dumpTxtFile(outputDIPTxt_,false); // for DQM/DIP
506  for(size_t i= 0; i < 7; i++)ForDIPPV_.push_back(0.0);
507  }
508 
509  return fit_ok && pv_fit_ok;
510 }
math::Error< dimension >::type CovarianceMatrix
Definition: BeamSpot.h:31
reco::BeamSpot fbeamspot
Definition: BeamFitter.h:141
double z0() const
z coordinate
Definition: BeamSpot.h:68
int i
Definition: DBlmapReader.cc:9
char fendTimeOfFit[32]
Definition: BeamFitter.h:228
std::map< int, reco::BeamSpot > getBeamSpotMap()
Definition: PVFitter.h:92
math::XYZPoint Point
point in the space
Definition: BeamSpot.h:29
void setType(BeamType type)
set beam type
Definition: BeamSpot.h:131
std::time_t freftime[2]
Definition: BeamFitter.h:220
PVFitter * MyPVFitter
Definition: BeamFitter.h:251
double dydz() const
dydz slope
Definition: BeamSpot.h:84
std::string outputTxt_
Definition: BeamFitter.h:156
void setBeamWidthY(double v)
Definition: BeamSpot.h:109
bool runFitterNoTxt()
Definition: BeamFitter.cc:512
T sqrt(T t)
Definition: SSEVec.h:48
char fbeginTimeOfFit[32]
Definition: BeamFitter.h:227
int j
Definition: DBlmapReader.cc:9
double BeamWidthX() const
beam width X
Definition: BeamSpot.h:86
double dxdz() const
dxdz slope
Definition: BeamSpot.h:82
int k[5][pyjets_maxn]
bool writeTxt_
Definition: BeamFitter.h:153
std::string outputDIPTxt_
Definition: BeamFitter.h:157
void dumpTxtFile(std::string &, bool)
Definition: BeamFitter.cc:636
std::vector< float > ForDIPPV_
Definition: BeamFitter.h:178
double inputBeamWidth_
Definition: BeamFitter.h:169
bool runFitter()
Definition: PVFitter.cc:334
double sigmaZ() const
sigma z
Definition: BeamSpot.h:80
double BeamWidthY() const
beam width Y
Definition: BeamSpot.h:88
bool writeDIPTxt_
Definition: BeamFitter.h:154
bool runBXFitter()
Definition: PVFitter.cc:203
std::map< int, reco::BeamSpot > fbspotPVMap
Definition: BeamFitter.h:143
double covariance(int i, int j) const
(i,j)-th element of error matrix
Definition: BeamSpot.h:112
double y0() const
y coordinate
Definition: BeamSpot.h:66
reco::BeamSpot getBeamSpot()
Definition: PVFitter.h:91
bool writeDIPBadFit_
Definition: BeamFitter.h:155
bool IsFitPerBunchCrossing()
Definition: PVFitter.h:93
Power< A, B >::type pow(const A &a, const B &b)
Definition: Power.h:40
double getWidthXerr()
Definition: PVFitter.h:57
BeamType type() const
return beam type
Definition: BeamSpot.h:129
double x0() const
x coordinate
Definition: BeamSpot.h:64
void BeamFitter::setFitLSRange ( int  ls0,
int  ls1 
)
inline

Definition at line 120 of file BeamFitter.h.

References fbeginLumiOfFit, and fendLumiOfFit.

Referenced by BeamSpotAnalyzer::endLuminosityBlock(), AlcaBeamSpotProducer::endLuminosityBlockProduce(), and BeamMonitor::FitAndFill().

120  {
121  fbeginLumiOfFit = ls0;
122  fendLumiOfFit = ls1;
123  }
int fendLumiOfFit
Definition: BeamFitter.h:226
int fbeginLumiOfFit
Definition: BeamFitter.h:225
void BeamFitter::SetPVInfo ( const std::vector< float > &  v1_)
inline

Definition at line 84 of file BeamFitter.h.

References ForDIPPV_.

Referenced by BeamMonitor::FitAndFill().

84  {
85  ForDIPPV_.clear();
86  ForDIPPV_.assign( v1_.begin(), v1_.end() );
87  }
std::vector< float > ForDIPPV_
Definition: BeamFitter.h:178
void BeamFitter::setRefTime ( time_t  t0,
time_t  t1 
)
inline

Definition at line 57 of file BeamFitter.h.

References freftime, and updateBTime().

Referenced by BeamSpotAnalyzer::endLuminosityBlock(), AlcaBeamSpotProducer::endLuminosityBlockProduce(), and BeamMonitor::FitAndFill().

57  {
58  freftime[0] = t0;
59  freftime[1] = t1;
60  // Make sure the string representation of the time
61  // is up-to-date
62  updateBTime();
63  }
std::time_t freftime[2]
Definition: BeamFitter.h:220
void updateBTime()
Definition: BeamFitter.cc:40
void BeamFitter::setRun ( int  run)
inline
void BeamFitter::subtractFromCutFlow ( const TH1F *  toSubtract)
inline

Definition at line 98 of file BeamFitter.h.

References countPass, h1cutFlow, and i.

Referenced by BeamMonitor::FitAndFill().

98  {
99  h1cutFlow->Add(toSubtract, -1.0);
100  for (unsigned int i=0; i<sizeof(countPass)/sizeof(countPass[0]); i++){
101  countPass[i] = h1cutFlow->GetBinContent(i+1);
102  }
103  }
int i
Definition: DBlmapReader.cc:9
int countPass[9]
Definition: BeamFitter.h:249
TH1F * h1cutFlow
Definition: BeamFitter.h:248
void BeamFitter::updateBTime ( )
private

Definition at line 40 of file BeamFitter.cc.

References fbeginTimeOfFit, fendTimeOfFit, formatBTime(), and freftime.

Referenced by readEvent(), and setRefTime().

40  {
41  const char* fbeginTime = formatBTime(freftime[0]);
42  sprintf(fbeginTimeOfFit,"%s",fbeginTime);
43  const char* fendTime = formatBTime(freftime[1]);
44  sprintf(fendTimeOfFit,"%s",fendTime);
45 }
char fendTimeOfFit[32]
Definition: BeamFitter.h:228
const char * formatBTime(const std::time_t &)
Definition: BeamFitter.cc:30
std::time_t freftime[2]
Definition: BeamFitter.h:220
char fbeginTimeOfFit[32]
Definition: BeamFitter.h:227
void BeamFitter::write2DB ( )

Definition at line 740 of file BeamFitter.cc.

References cond::service::PoolDBOutputService::appendSinceTime(), reco::BeamSpot::BeamWidthX(), reco::BeamSpot::BeamWidthY(), cond::service::PoolDBOutputService::beginOfTime(), gather_cfg::cout, reco::BeamSpot::covariance(), cond::service::PoolDBOutputService::createNewIOV(), cond::service::PoolDBOutputService::currentTime(), reco::BeamSpot::dxdz(), reco::BeamSpot::dydz(), cond::service::PoolDBOutputService::endOfTime(), fbeamspot, i, edm::Service< T >::isAvailable(), cond::service::PoolDBOutputService::isNewTagRequest(), j, reco::BeamSpot::position(), BeamSpotObjects::SetBeamWidthX(), BeamSpotObjects::SetBeamWidthY(), BeamSpotObjects::SetCovariance(), BeamSpotObjects::Setdxdz(), BeamSpotObjects::Setdydz(), BeamSpotObjects::SetPosition(), BeamSpotObjects::SetSigmaZ(), and reco::BeamSpot::sigmaZ().

Referenced by BeamSpotAnalyzer::endJob().

740  {
741  BeamSpotObjects *pBSObjects = new BeamSpotObjects();
742 
743  pBSObjects->SetPosition(fbeamspot.position().X(),fbeamspot.position().Y(),fbeamspot.position().Z());
744  //std::cout << " wrote: x= " << fbeamspot.position().X() << " y= "<< fbeamspot.position().Y() << " z= " << fbeamspot.position().Z() << std::endl;
745  pBSObjects->SetSigmaZ(fbeamspot.sigmaZ());
746  pBSObjects->Setdxdz(fbeamspot.dxdz());
747  pBSObjects->Setdydz(fbeamspot.dydz());
748  //if (inputBeamWidth_ > 0 ) {
749  // std::cout << " beam width value forced to be " << inputBeamWidth_ << std::endl;
750  // pBSObjects->SetBeamWidthX(inputBeamWidth_);
751  // pBSObjects->SetBeamWidthY(inputBeamWidth_);
752  //} else {
753  // need to fix this
754  //std::cout << " using default value, 15e-4, for beam width!!!"<<std::endl;
755  pBSObjects->SetBeamWidthX(fbeamspot.BeamWidthX() );
756  pBSObjects->SetBeamWidthY(fbeamspot.BeamWidthY() );
757  //}
758 
759  for (int i = 0; i<7; ++i) {
760  for (int j=0; j<7; ++j) {
761  pBSObjects->SetCovariance(i,j,fbeamspot.covariance(i,j));
762  }
763  }
765  if( poolDbService.isAvailable() ) {
766  std::cout << "poolDBService available"<<std::endl;
767  if ( poolDbService->isNewTagRequest( "BeamSpotObjectsRcd" ) ) {
768  std::cout << "new tag requested" << std::endl;
769  poolDbService->createNewIOV<BeamSpotObjects>( pBSObjects, poolDbService->beginOfTime(),poolDbService->endOfTime(),
770  "BeamSpotObjectsRcd" );
771  }
772  else {
773  std::cout << "no new tag requested" << std::endl;
774  poolDbService->appendSinceTime<BeamSpotObjects>( pBSObjects, poolDbService->currentTime(),
775  "BeamSpotObjectsRcd" );
776  }
777  }
778 }
reco::BeamSpot fbeamspot
Definition: BeamFitter.h:141
int i
Definition: DBlmapReader.cc:9
void SetSigmaZ(double val)
set sigma Z, RMS bunch length
void SetCovariance(int i, int j, double val)
set i,j element of the full covariance matrix 7x7
void Setdydz(double val)
set dydz slope, crossing angle in XZ
double dydz() const
dydz slope
Definition: BeamSpot.h:84
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:46
int j
Definition: DBlmapReader.cc:9
double BeamWidthX() const
beam width X
Definition: BeamSpot.h:86
void Setdxdz(double val)
set dxdz slope, crossing angle
void createNewIOV(T *firstPayloadObj, cond::Time_t firstSinceTime, cond::Time_t firstTillTime, const std::string &recordName, bool withlogging=false)
double dxdz() const
dxdz slope
Definition: BeamSpot.h:82
double sigmaZ() const
sigma z
Definition: BeamSpot.h:80
double BeamWidthY() const
beam width Y
Definition: BeamSpot.h:88
void SetBeamWidthX(double val)
set average transverse beam width X
void SetBeamWidthY(double val)
set average transverse beam width Y
double covariance(int i, int j) const
(i,j)-th element of error matrix
Definition: BeamSpot.h:112
tuple cout
Definition: gather_cfg.py:121
const Point & position() const
position
Definition: BeamSpot.h:62
void SetPosition(double x, double y, double z)
set XYZ position

Member Data Documentation

std::vector<reco::TrackBase::TrackAlgorithm> BeamFitter::algorithm_
private

Definition at line 168 of file BeamFitter.h.

Referenced by BeamFitter(), and readEvent().

bool BeamFitter::appendRunTxt_
private

Definition at line 149 of file BeamFitter.h.

Referenced by BeamFitter(), and dumpTxtFile().

edm::EDGetTokenT<reco::BeamSpot> BeamFitter::beamSpotToken_
private

Definition at line 152 of file BeamFitter.h.

Referenced by BeamFitter(), and readEvent().

double BeamFitter::convergence_
private

Definition at line 170 of file BeamFitter.h.

Referenced by BeamFitter(), runBeamWidthFitter(), and runFitterNoTxt().

int BeamFitter::countPass[9]
private

Definition at line 249 of file BeamFitter.h.

Referenced by readEvent(), resetCutFlow(), and subtractFromCutFlow().

bool BeamFitter::debug_
private

Definition at line 148 of file BeamFitter.h.

Referenced by BeamFitter(), readEvent(), and runAllFitter().

bool BeamFitter::falgo
private

Definition at line 217 of file BeamFitter.h.

Referenced by BeamFitter(), and readEvent().

std::ofstream BeamFitter::fasciiDIP
private

Definition at line 146 of file BeamFitter.h.

Referenced by BeamFitter().

std::ofstream BeamFitter::fasciiFile
private

Definition at line 145 of file BeamFitter.h.

reco::BeamSpot BeamFitter::fbeamspot
private
reco::BeamSpot BeamFitter::fbeamWidthFit
private

Definition at line 142 of file BeamFitter.h.

Referenced by dumpBWTxtFile(), getBeamWidth(), and runBeamWidthFitter().

int BeamFitter::fbeginLumiOfFit
private
char BeamFitter::fbeginTimeOfFit[32]
private

Definition at line 227 of file BeamFitter.h.

Referenced by BeamFitter(), dumpTxtFile(), runFitterNoTxt(), runPVandTrkFitter(), and updateBTime().

std::map< int, reco::BeamSpot> BeamFitter::fbspotPVMap
private

Definition at line 143 of file BeamFitter.h.

Referenced by dumpTxtFile(), getBeamSpotMap(), and runPVandTrkFitter().

std::vector<BSTrkParameters> BeamFitter::fBSvector
private
int BeamFitter::fcharge
private

Definition at line 192 of file BeamFitter.h.

Referenced by BeamFitter(), and readEvent().

double BeamFitter::fcov[7][7]
private

Definition at line 211 of file BeamFitter.h.

Referenced by BeamFitter(), and readEvent().

double BeamFitter::fd0
private

Definition at line 195 of file BeamFitter.h.

Referenced by BeamFitter(), and readEvent().

double BeamFitter::fd0bs
private

Definition at line 196 of file BeamFitter.h.

Referenced by BeamFitter(), and readEvent().

double BeamFitter::fd0phi_chi2
private

Definition at line 209 of file BeamFitter.h.

double BeamFitter::fd0phi_d0
private

Definition at line 210 of file BeamFitter.h.

double BeamFitter::fdxdz
private

Definition at line 233 of file BeamFitter.h.

Referenced by BeamFitter(), and runFitterNoTxt().

double BeamFitter::fdxdzErr
private

Definition at line 239 of file BeamFitter.h.

Referenced by BeamFitter(), and runFitterNoTxt().

double BeamFitter::fdydz
private

Definition at line 234 of file BeamFitter.h.

Referenced by BeamFitter(), and runFitterNoTxt().

double BeamFitter::fdydzErr
private

Definition at line 240 of file BeamFitter.h.

Referenced by BeamFitter(), and runFitterNoTxt().

int BeamFitter::fendLumiOfFit
private
char BeamFitter::fendTimeOfFit[32]
private

Definition at line 228 of file BeamFitter.h.

Referenced by BeamFitter(), dumpTxtFile(), runFitterNoTxt(), runPVandTrkFitter(), and updateBTime().

double BeamFitter::feta
private

Definition at line 191 of file BeamFitter.h.

Referenced by BeamFitter(), and readEvent().

bool BeamFitter::ffilename_changed
private

Definition at line 175 of file BeamFitter.h.

Referenced by BeamFitter(), and dumpTxtFile().

TFile* BeamFitter::file_
private

Definition at line 187 of file BeamFitter.h.

Referenced by BeamFitter(), and ~BeamFitter().

bool BeamFitter::fitted_
private

Definition at line 174 of file BeamFitter.h.

Referenced by BeamFitter(), runFitterNoTxt(), and ~BeamFitter().

int BeamFitter::flumi
private

Definition at line 215 of file BeamFitter.h.

Referenced by BeamFitter(), and readEvent().

BSFitter* BeamFitter::fmyalgo
private

Definition at line 144 of file BeamFitter.h.

double BeamFitter::fnormchi2
private

Definition at line 193 of file BeamFitter.h.

Referenced by BeamFitter(), and readEvent().

int BeamFitter::fnPixelLayerMeas
private

Definition at line 201 of file BeamFitter.h.

Referenced by BeamFitter(), and readEvent().

int BeamFitter::fnPXBLayerMeas
private

Definition at line 207 of file BeamFitter.h.

Referenced by BeamFitter(), and readEvent().

int BeamFitter::fnPXFLayerMeas
private

Definition at line 208 of file BeamFitter.h.

Referenced by BeamFitter(), and readEvent().

int BeamFitter::fnStripLayerMeas
private

Definition at line 202 of file BeamFitter.h.

Referenced by BeamFitter(), and readEvent().

int BeamFitter::fnTECLayerMeas
private

Definition at line 206 of file BeamFitter.h.

Referenced by BeamFitter(), and readEvent().

int BeamFitter::fnTIBLayerMeas
private

Definition at line 203 of file BeamFitter.h.

Referenced by BeamFitter(), and readEvent().

int BeamFitter::fnTIDLayerMeas
private

Definition at line 204 of file BeamFitter.h.

Referenced by BeamFitter(), and readEvent().

int BeamFitter::fnTOBLayerMeas
private

Definition at line 205 of file BeamFitter.h.

Referenced by BeamFitter(), and readEvent().

int BeamFitter::fnTotLayerMeas
private

Definition at line 200 of file BeamFitter.h.

Referenced by BeamFitter(), and readEvent().

std::vector<float> BeamFitter::ForDIPPV_
private

Definition at line 178 of file BeamFitter.h.

Referenced by dumpTxtFile(), runPVandTrkFitter(), and SetPVInfo().

double BeamFitter::fphi0
private

Definition at line 194 of file BeamFitter.h.

Referenced by BeamFitter(), and readEvent().

double BeamFitter::fpt
private

Definition at line 190 of file BeamFitter.h.

Referenced by BeamFitter(), and readEvent().

TTree* BeamFitter::fPVTree_
private

Definition at line 252 of file BeamFitter.h.

Referenced by BeamFitter(), and ~BeamFitter().

bool BeamFitter::fpvValid
private

Definition at line 218 of file BeamFitter.h.

Referenced by BeamFitter(), and readEvent().

double BeamFitter::fpvx
private

Definition at line 219 of file BeamFitter.h.

Referenced by BeamFitter(), and readEvent().

double BeamFitter::fpvy
private

Definition at line 219 of file BeamFitter.h.

Referenced by BeamFitter(), and readEvent().

double BeamFitter::fpvz
private

Definition at line 219 of file BeamFitter.h.

Referenced by BeamFitter(), and readEvent().

bool BeamFitter::fquality
private

Definition at line 216 of file BeamFitter.h.

Referenced by BeamFitter(), and readEvent().

std::time_t BeamFitter::freftime[2]
private
int BeamFitter::frun
private

Definition at line 214 of file BeamFitter.h.

Referenced by BeamFitter(), dumpTxtFile(), getRunNumber(), readEvent(), and setRun().

int BeamFitter::frunFit
private

Definition at line 224 of file BeamFitter.h.

Referenced by BeamFitter(), and readEvent().

double BeamFitter::fsigmad0
private

Definition at line 197 of file BeamFitter.h.

Referenced by BeamFitter(), and readEvent().

double BeamFitter::fsigmaZ
private

Definition at line 232 of file BeamFitter.h.

Referenced by BeamFitter(), and runFitterNoTxt().

double BeamFitter::fsigmaz0
private

Definition at line 199 of file BeamFitter.h.

Referenced by BeamFitter(), and readEvent().

double BeamFitter::fsigmaZErr
private

Definition at line 238 of file BeamFitter.h.

Referenced by BeamFitter(), and runFitterNoTxt().

double BeamFitter::ftheta
private

Definition at line 189 of file BeamFitter.h.

Referenced by BeamFitter(), and readEvent().

int BeamFitter::ftotal_tracks
private
TTree* BeamFitter::ftree_
private

Definition at line 188 of file BeamFitter.h.

Referenced by BeamFitter(), readEvent(), and ~BeamFitter().

TTree* BeamFitter::ftreeFit_
private

Definition at line 223 of file BeamFitter.h.

Referenced by BeamFitter(), runFitterNoTxt(), and ~BeamFitter().

double BeamFitter::fvx
private

Definition at line 212 of file BeamFitter.h.

Referenced by BeamFitter(), and readEvent().

double BeamFitter::fvy
private

Definition at line 213 of file BeamFitter.h.

Referenced by BeamFitter(), and readEvent().

double BeamFitter::fwidthX
private

Definition at line 241 of file BeamFitter.h.

Referenced by BeamFitter(), and runFitterNoTxt().

double BeamFitter::fwidthXErr
private

Definition at line 243 of file BeamFitter.h.

Referenced by BeamFitter(), and runFitterNoTxt().

double BeamFitter::fwidthY
private

Definition at line 242 of file BeamFitter.h.

Referenced by BeamFitter(), and runFitterNoTxt().

double BeamFitter::fwidthYErr
private

Definition at line 244 of file BeamFitter.h.

Referenced by BeamFitter(), and runFitterNoTxt().

double BeamFitter::fx
private

Definition at line 229 of file BeamFitter.h.

Referenced by BeamFitter(), and runFitterNoTxt().

double BeamFitter::fxErr
private

Definition at line 235 of file BeamFitter.h.

Referenced by BeamFitter(), and runFitterNoTxt().

double BeamFitter::fy
private

Definition at line 230 of file BeamFitter.h.

Referenced by BeamFitter(), and runFitterNoTxt().

double BeamFitter::fyErr
private

Definition at line 236 of file BeamFitter.h.

Referenced by BeamFitter(), and runFitterNoTxt().

double BeamFitter::fz
private

Definition at line 231 of file BeamFitter.h.

Referenced by BeamFitter(), and runFitterNoTxt().

double BeamFitter::fz0
private

Definition at line 198 of file BeamFitter.h.

Referenced by BeamFitter(), and readEvent().

double BeamFitter::fzErr
private

Definition at line 237 of file BeamFitter.h.

Referenced by BeamFitter(), and runFitterNoTxt().

TH1F* BeamFitter::h1cutFlow
private
TH1F* BeamFitter::h1ntrks
private

Definition at line 246 of file BeamFitter.h.

Referenced by BeamFitter(), readEvent(), and ~BeamFitter().

TH1F* BeamFitter::h1vz_event
private

Definition at line 247 of file BeamFitter.h.

Referenced by BeamFitter(), readEvent(), and ~BeamFitter().

TH1F* BeamFitter::h1z
private

Definition at line 182 of file BeamFitter.h.

Referenced by runFitterNoTxt(), and ~BeamFitter().

double BeamFitter::inputBeamWidth_
private

Definition at line 169 of file BeamFitter.h.

Referenced by BeamFitter(), runBeamWidthFitter(), runFitterNoTxt(), and runPVandTrkFitter().

bool BeamFitter::isMuon_
private

Definition at line 173 of file BeamFitter.h.

Referenced by BeamFitter(), and readEvent().

int BeamFitter::min_Ntrks_
private

Definition at line 172 of file BeamFitter.h.

Referenced by BeamFitter(), runBeamWidthFitter(), and runFitterNoTxt().

PVFitter* BeamFitter::MyPVFitter
private
std::string BeamFitter::outputDIPTxt_
private

Definition at line 157 of file BeamFitter.h.

Referenced by BeamFitter(), runFitter(), and runPVandTrkFitter().

std::string BeamFitter::outputfilename_
private

Definition at line 186 of file BeamFitter.h.

Referenced by BeamFitter().

std::string BeamFitter::outputTxt_
private
std::vector<reco::TrackBase::TrackQuality> BeamFitter::quality_
private

Definition at line 167 of file BeamFitter.h.

Referenced by BeamFitter(), and readEvent().

bool BeamFitter::saveBeamFit_
private

Definition at line 184 of file BeamFitter.h.

Referenced by BeamFitter(), runFitterNoTxt(), and ~BeamFitter().

bool BeamFitter::saveNtuple_
private

Definition at line 183 of file BeamFitter.h.

Referenced by BeamFitter(), readEvent(), and ~BeamFitter().

bool BeamFitter::savePVVertices_
private

Definition at line 185 of file BeamFitter.h.

Referenced by BeamFitter(), and ~BeamFitter().

edm::EDGetTokenT<reco::TrackCollection> BeamFitter::tracksToken_
private

Definition at line 150 of file BeamFitter.h.

Referenced by BeamFitter(), and readEvent().

std::vector<std::string> BeamFitter::trk_Algorithm_
private

Definition at line 165 of file BeamFitter.h.

Referenced by BeamFitter().

double BeamFitter::trk_MaxEta_
private

Definition at line 160 of file BeamFitter.h.

Referenced by BeamFitter(), and readEvent().

double BeamFitter::trk_MaxIP_
private

Definition at line 161 of file BeamFitter.h.

Referenced by BeamFitter(), and readEvent().

double BeamFitter::trk_MaxNormChi2_
private

Definition at line 164 of file BeamFitter.h.

Referenced by BeamFitter(), and readEvent().

double BeamFitter::trk_MaxZ_
private

Definition at line 159 of file BeamFitter.h.

Referenced by BeamFitter(), readEvent(), runBeamWidthFitter(), and runFitterNoTxt().

int BeamFitter::trk_MinNPixLayers_
private

Definition at line 163 of file BeamFitter.h.

Referenced by BeamFitter(), and readEvent().

int BeamFitter::trk_MinNTotLayers_
private

Definition at line 162 of file BeamFitter.h.

Referenced by BeamFitter(), and readEvent().

double BeamFitter::trk_MinpT_
private

Definition at line 158 of file BeamFitter.h.

Referenced by BeamFitter(), and readEvent().

std::vector<std::string> BeamFitter::trk_Quality_
private

Definition at line 166 of file BeamFitter.h.

Referenced by BeamFitter().

edm::EDGetTokenT<edm::View<reco::Vertex> > BeamFitter::vertexToken_
private

Definition at line 151 of file BeamFitter.h.

Referenced by BeamFitter(), and readEvent().

bool BeamFitter::writeDIPBadFit_
private

Definition at line 155 of file BeamFitter.h.

Referenced by BeamFitter(), runFitter(), and runPVandTrkFitter().

bool BeamFitter::writeDIPTxt_
private

Definition at line 154 of file BeamFitter.h.

Referenced by BeamFitter(), runFitter(), and runPVandTrkFitter().

bool BeamFitter::writeTxt_
private

Definition at line 153 of file BeamFitter.h.

Referenced by BeamFitter(), runBeamWidthFitter(), runFitter(), and runPVandTrkFitter().