|
|
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");
236 beamFitter.
addUntracked<
bool>(
"WriteDIPOnBadFit",
true);
245 beamFitter.
addUntracked<
double>(
"MaximumImpactParameter");
250 beamFitter.
addUntracked<std::vector<std::string> >(
"TrackAlgorithm");
251 beamFitter.
addUntracked<std::vector<std::string> >(
"TrackQuality");
253 beamFitter.
addUntracked<
double>(
"FractionOfFittedTrks");
264 const std::time_t ftmptime = ftimestamp >> 32;
299 refBS = recoBeamSpotHandle.
product();
342 for (
int i = 0;
i < 5; ++
i) {
343 for (
int j = 0;
j < 5; ++
j) {
354 for (
unsigned int i = 0;
i <
quality_.size(); ++
i) {
376 for (
size_t ipv = 0; ipv !=
pv.size(); ++ipv) {
377 if (!
pv[ipv].isFake())
380 if (ipv == 0 && !
pv[0].isFake()) {
414 edm::LogInfo(
"BeamFitter") <<
"Selected track quality = " <<
track->qualityMask()
415 <<
"; track algorithm = " <<
track->algoName()
416 <<
"= TrackAlgorithm: " <<
track->algo() << std::endl;
437 for (std::vector<BSTrkParameters>::const_iterator iparam =
fBSvector.begin(); iparam !=
fBSvector.end(); ++iparam) {
438 eventZ += fabs(iparam->z0() - averageZ);
452 bool pv_fit_ok =
false;
502 for (
int j = 0;
j < 7; ++
j) {
503 for (
int k =
j;
k < 7; ++
k) {
508 if (pv_fit_ok && fit_ok) {
525 if (pv_fit_ok && fit_ok) {
527 }
else if (!pv_fit_ok && fit_ok) {
529 }
else if (pv_fit_ok && !fit_ok) {
531 }
else if (!pv_fit_ok && !fit_ok) {
539 for (
size_t i = 0;
i < 7;
i++)
543 return fit_ok && pv_fit_ok;
553 edm::LogWarning(
"BeamFitter") <<
"No event read! No Fitting!" << std::endl;
560 edm::LogInfo(
"BeamFitter") <<
"Calculating beam spot..." << std::endl
603 edm::LogInfo(
"BeamFitter") <<
"Not enough good tracks selected! No beam fit!" << std::endl;
621 bool widthfit_ok =
false;
624 edm::LogInfo(
"BeamFitter") <<
"Calculating beam spot positions('d0-phi0' method) and width using llh Fit"
651 edm::LogWarning(
"BeamFitter") <<
"Not enough good tracks selected! No beam fit!" << std::endl;
659 outFile <<
"---------------------------------------------------------------------------------------------------------"
660 "----------------------------------------------------"
662 outFile <<
"Beam width(in cm) from Log-likelihood fit (Here we assume a symmetric beam(SigmaX=SigmaY)!)" << std::endl;
686 for (std::map<int, reco::BeamSpot>::const_iterator abspot =
fbspotPVMap.begin(); abspot !=
fbspotPVMap.end();
689 int bx = abspot->first;
691 outFile <<
"Runnumber " <<
frun <<
" bx " <<
bx << std::endl;
695 outFile <<
"Type " << beamspottmp.
type() << std::endl;
696 outFile <<
"X0 " << beamspottmp.
x0() << std::endl;
697 outFile <<
"Y0 " << beamspottmp.
y0() << std::endl;
698 outFile <<
"Z0 " << beamspottmp.
z0() << std::endl;
700 outFile <<
"dxdz " << beamspottmp.
dxdz() << std::endl;
701 outFile <<
"dydz " << beamspottmp.
dydz() << std::endl;
704 for (
int i = 0;
i < 6; ++
i) {
706 for (
int j = 0;
j < 7; ++
j) {
765 for (
int i = 0;
i < 7; ++
i) {
766 for (
int j = 0;
j < 7; ++
j) {
772 std::cout <<
"poolDBService available" << std::endl;
774 std::cout <<
"new tag requested" << std::endl;
778 std::cout <<
"no new tag requested" << std::endl;
791 std::cout <<
" d0-phi Iterative:" << std::endl;
797 std::cout <<
"\n Now run tests of the different fits\n";
805 std::cout <<
" z Chi2 Fit ONLY:" << std::endl;
806 std::cout << beam_fit_z_chi2 << std::endl;
809 fit_type =
"combined";
814 std::cout <<
" z Log-Likelihood Fit ONLY:" << std::endl;
822 std::cout <<
" d0-phi0 Fit ONLY:" << std::endl;
846 std::cout <<
"No good track selected! No beam fit!" << std::endl;
edm::EDGetTokenT< reco::BeamSpot > beamSpotToken_
reco::BeamSpot Fit_d0phi()
ParameterDescriptionBase * add(U const &iLabel, T const &value)
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
Log< level::Info, false > LogInfo
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_
Log< level::Warning, false > LogWarning
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)
static void fillDescription(edm::ParameterSetDescription &)
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
ParameterDescriptionBase * addUntracked(U const &iLabel, T const &value)
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)
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)
T getParameter(std::string const &) const
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)