|
|
Go to the documentation of this file.
30 char ts[] =
"yyyy.mn.dd hh:mm:ss zzz ";
31 char *fbeginTime = ts;
32 strftime(fbeginTime,
sizeof(ts),
"%Y.%m.%d %H:%M:%S GMT", gmtime(&
freftime[0]));
35 strftime(fendTime,
sizeof(ts),
"%Y.%m.%d %H:%M:%S GMT", gmtime(&
freftime[1]));
75 .getUntrackedParameter<std::vector<std::string> >(
"TrackAlgorithm");
77 .getUntrackedParameter<std::vector<std::string> >(
"TrackQuality");
95 ftree_ =
new TTree(
"mytree",
"mytree");
131 ftreeFit_ =
new TTree(
"fitResults",
"fitResults");
169 h1ntrks =
new TH1F(
"h1ntrks",
"number of tracks per event", 50, 0, 50);
170 h1vz_event =
new TH1F(
"h1vz_event",
"track Vz", 50, -30, 30);
171 h1cutFlow =
new TH1F(
"h1cutFlow",
"Cut flow table of track selection", 9, 0, 9);
172 h1cutFlow->GetXaxis()->SetBinLabel(1,
"No cut");
173 h1cutFlow->GetXaxis()->SetBinLabel(2,
"Traker hits");
174 h1cutFlow->GetXaxis()->SetBinLabel(3,
"Pixel hits");
175 h1cutFlow->GetXaxis()->SetBinLabel(4,
"norm. #chi^{2}");
176 h1cutFlow->GetXaxis()->SetBinLabel(5,
"algo");
177 h1cutFlow->GetXaxis()->SetBinLabel(6,
"quality");
178 h1cutFlow->GetXaxis()->SetBinLabel(7,
"d_{0}");
179 h1cutFlow->GetXaxis()->SetBinLabel(8,
"z_{0}");
180 h1cutFlow->GetXaxis()->SetBinLabel(9,
"p_{T}");
187 fPVTree_ =
new TTree(
"PrimaryVertices",
"PrimaryVertices");
227 const std::time_t ftmptime = ftimestamp >> 32;
262 refBS = recoBeamSpotHandle.
product();
305 for (
int i = 0;
i < 5; ++
i) {
306 for (
int j = 0;
j < 5; ++
j) {
317 for (
unsigned int i = 0;
i <
quality_.size(); ++
i) {
339 for (
size_t ipv = 0; ipv !=
pv.size(); ++ipv) {
340 if (!
pv[ipv].isFake())
343 if (ipv == 0 && !
pv[0].isFake()) {
377 edm::LogInfo(
"BeamFitter") <<
"Selected track quality = " <<
track->qualityMask()
378 <<
"; track algorithm = " <<
track->algoName()
379 <<
"= TrackAlgorithm: " <<
track->algo() << std::endl;
400 for (std::vector<BSTrkParameters>::const_iterator iparam =
fBSvector.begin(); iparam !=
fBSvector.end(); ++iparam) {
401 eventZ += fabs(iparam->z0() - averageZ);
415 bool pv_fit_ok =
false;
465 for (
int j = 0;
j < 7; ++
j) {
466 for (
int k =
j;
k < 7; ++
k) {
471 if (pv_fit_ok && fit_ok) {
488 if (pv_fit_ok && fit_ok) {
490 }
else if (!pv_fit_ok && fit_ok) {
492 }
else if (pv_fit_ok && !fit_ok) {
494 }
else if (!pv_fit_ok && !fit_ok) {
502 for (
size_t i = 0;
i < 7;
i++)
506 return fit_ok && pv_fit_ok;
516 edm::LogWarning(
"BeamFitter") <<
"No event read! No Fitting!" << std::endl;
523 edm::LogInfo(
"BeamFitter") <<
"Calculating beam spot..." << std::endl
566 edm::LogInfo(
"BeamFitter") <<
"Not enough good tracks selected! No beam fit!" << std::endl;
584 bool widthfit_ok =
false;
587 edm::LogInfo(
"BeamFitter") <<
"Calculating beam spot positions('d0-phi0' method) and width using llh Fit"
614 edm::LogWarning(
"BeamFitter") <<
"Not enough good tracks selected! No beam fit!" << std::endl;
622 outFile <<
"---------------------------------------------------------------------------------------------------------"
623 "----------------------------------------------------"
625 outFile <<
"Beam width(in cm) from Log-likelihood fit (Here we assume a symmetric beam(SigmaX=SigmaY)!)" << std::endl;
649 for (std::map<int, reco::BeamSpot>::const_iterator abspot =
fbspotPVMap.begin(); abspot !=
fbspotPVMap.end();
652 int bx = abspot->first;
654 outFile <<
"Runnumber " <<
frun <<
" bx " <<
bx << std::endl;
658 outFile <<
"Type " << beamspottmp.
type() << std::endl;
659 outFile <<
"X0 " << beamspottmp.
x0() << std::endl;
660 outFile <<
"Y0 " << beamspottmp.
y0() << std::endl;
661 outFile <<
"Z0 " << beamspottmp.
z0() << std::endl;
663 outFile <<
"dxdz " << beamspottmp.
dxdz() << std::endl;
664 outFile <<
"dydz " << beamspottmp.
dydz() << std::endl;
667 for (
int i = 0;
i < 6; ++
i) {
669 for (
int j = 0;
j < 7; ++
j) {
728 for (
int i = 0;
i < 7; ++
i) {
729 for (
int j = 0;
j < 7; ++
j) {
735 std::cout <<
"poolDBService available" << std::endl;
737 std::cout <<
"new tag requested" << std::endl;
741 std::cout <<
"no new tag requested" << std::endl;
754 std::cout <<
" d0-phi Iterative:" << std::endl;
760 std::cout <<
"\n Now run tests of the different fits\n";
768 std::cout <<
" z Chi2 Fit ONLY:" << std::endl;
769 std::cout << beam_fit_z_chi2 << std::endl;
772 fit_type =
"combined";
777 std::cout <<
" z Log-Likelihood Fit ONLY:" << std::endl;
785 std::cout <<
" d0-phi0 Fit ONLY:" << std::endl;
809 std::cout <<
"No good track selected! No beam fit!" << std::endl;
edm::EDGetTokenT< reco::BeamSpot > beamSpotToken_
reco::BeamSpot Fit_d0phi()
void setBeamWidthY(double v)
std::vector< reco::TrackBase::TrackQuality > quality_
double emittanceX() const
additional information
double BeamWidthXError() const
error on beam width X, assume error in X = Y
int pixelEndcapLayersWithMeasurement() const
T const * product() const
cond::Time_t beginOfTime() const
int stripTOBLayersWithMeasurement() const
edm::EDGetTokenT< edm::View< reco::Vertex > > vertexToken_
double z0() const
z coordinate
void appendSinceTime(const T *payloadObj, cond::Time_t sinceTime, const std::string &recordName)
void readEvent(const edm::Event &iEvent)
double covariance(int i, int j) const
(i,j)-th element of error matrix
std::vector< BSTrkParameters > fBSvector
void SetBeamWidthY(double val)
set average transverse beam width Y
T getUntrackedParameter(std::string const &, T const &) const
reco::BeamSpot fbeamWidthFit
double dxdz() const
dxdz slope
void SetMaximumZ(double z)
void find(edm::Handle< EcalRecHitCollection > &hits, DetId thisDet, std::vector< EcalRecHitCollection::const_iterator > &hit, bool debug=false)
double dxdzError() const
error on dxdz
std::string outputfilename_
int pixelLayersWithMeasurement() const
void SetSigmaZ(double val)
set sigma Z, RMS bunch length
double y0Error() const
error on y
int pixelBarrelLayersWithMeasurement() const
double sigmaZ() const
sigma z
void SetInputBeamWidth(double val)
int stripLayersWithMeasurement() const
void dumpBWTxtFile(std::string &)
void dumpBeamSpotTxt(std::ofstream &outFile, BeamSpotContainer const &bsContainer)
int trackerLayersWithMeasurement() const
double dydzError() const
error on dydz
void createNewIOV(const T *firstPayloadObj, cond::Time_t firstSinceTime, cond::Time_t, const std::string &recordName)
BeamType type() const
return beam type
void readEvent(const edm::Event &iEvent)
std::map< int, reco::BeamSpot > getBeamSpotMap()
std::vector< std::string > trk_Quality_
bool runBeamWidthFitter()
const Point & position() const
position
reco::BeamSpot Fit_ited0phi()
std::string outputDIPTxt_
void SetPosition(double x, double y, double z)
set XYZ position
int stripTIBLayersWithMeasurement() const
void SetConvergence(double val)
void SetCovariance(int i, int j, double val)
set i,j element of the full covariance matrix 7x7
std::vector< reco::TrackBase::TrackAlgorithm > algorithm_
double z0Error() const
error on z
void Setd0Cut_d0phi(double d0cut)
void dumpTxtFile(std::string &, bool)
double BeamWidthYError() const
error on beam width Y, assume error in X = Y
math::Error< dimension >::type CovarianceMatrix
double BeamWidthX() const
beam width X
void SetMinimumNTrks(int n)
void Setdxdz(double val)
set dxdz slope, crossing angle
edm::EDGetTokenT< reco::TrackCollection > tracksToken_
std::vector< std::string > trk_Algorithm_
double dydz() const
dydz slope
cond::Time_t endOfTime() const
static TrackQuality qualityByName(const std::string &name)
T getParameter(std::string const &) const
double x0() const
x coordinate
bool IsFitPerBunchCrossing()
int stripTIDLayersWithMeasurement() const
double x0Error() const
error on x
double sigmaZ0Error() const
error on sigma z
void SetBeamWidthX(double val)
set average transverse beam width X
void SetFitVariable(std::string name)
std::vector< float > ForDIPPV_
bool isNewTagRequest(const std::string &recordName)
Power< A, B >::type pow(const A &a, const B &b)
void SetFitType(std::string type)
static TrackAlgorithm algoByName(const std::string &name)
math::XYZPoint Point
point in the space
Abs< T >::type abs(const T &t)
int stripTECLayersWithMeasurement() const
void setType(BeamType type)
set beam type
double y0() const
y coordinate
std::map< int, reco::BeamSpot > fbspotPVMap
void Setdydz(double val)
set dydz slope, crossing angle in XZ
double emittanceY() const
std::vector< Track > TrackCollection
collection of Tracks
cond::Time_t currentTime() const
reco::BeamSpot getBeamSpot()
double BeamWidthY() const
beam width Y
unsigned long long TimeValue_t
void setTree(TTree *tree)