9 #include <reconstruction/modules/CDCDedxPID/CDCDedxPIDModule.h>
11 #include <reconstruction/dataobjects/DedxConstants.h>
12 #include <reconstruction/modules/CDCDedxPID/LineHelper.h>
14 #include <framework/gearbox/Const.h>
16 #include <cdc/dataobjects/CDCHit.h>
17 #include <cdc/dataobjects/CDCRecoHit.h>
19 #include <cdc/translators/LinearGlobalADCCountTranslator.h>
20 #include <cdc/translators/RealisticTDCCountTranslator.h>
22 #include <cdc/geometry/CDCGeometryPar.h>
23 #include <tracking/dataobjects/RecoHitInformation.h>
25 #include <genfit/AbsTrackRep.h>
26 #include <genfit/Exception.h>
27 #include <genfit/MaterialEffects.h>
28 #include <genfit/KalmanFitterInfo.h>
48 setDescription(
"Extract dE/dx and corresponding log-likelihood from fitted tracks and hits in the CDC.");
52 "Use parameterized means and resolutions to determine PID values. If false, lookup table PDFs are used.",
true);
54 "Portion of events with low dE/dx that should be discarded",
double(0.05));
56 "Portion of events with high dE/dx that should be discarded",
double(0.25));
58 "Whether to use the back half of curlers",
false);
60 "Option to write out debugging information to CDCDedxTracks (DataStore objects).",
true);
62 "If using lookup table PDFs, include PDF value for each hit in likelihood. If false, the truncated mean of dedx values will be used.",
65 "Ignore particles for which no PDFs are found",
false);
67 "ONLY USEFUL FOR MC: Use track-level MC. If false, use hit-level MC",
true);
69 "ONLY USEFUL FOR MC: Only save data for primary particles",
false);
76 if (!
m_DBDedxPDFs) B2FATAL(
"No Dedx pdfs found in database");
79 double xMin, xMax, yMin, yMax;
81 xMin = xMax = yMin = yMax = 0.0;
82 for (
unsigned int iPart = 0; iPart < 6; iPart++) {
86 if (pdf->GetEntries() == 0) {
89 B2FATAL(
"Couldn't find PDF for PDG " << pdgCode);
93 const double epsFactor = 1e-5;
94 if (nBinsX == -1 and nBinsY == -1) {
95 nBinsX = pdf->GetNbinsX();
96 nBinsY = pdf->GetNbinsY();
97 xMin = pdf->GetXaxis()->GetXmin();
98 xMax = pdf->GetXaxis()->GetXmax();
99 yMin = pdf->GetYaxis()->GetXmin();
100 yMax = pdf->GetYaxis()->GetXmax();
101 }
else if (nBinsX != pdf->GetNbinsX()
102 or nBinsY != pdf->GetNbinsY()
103 or fabs(xMin - pdf->GetXaxis()->GetXmin()) > epsFactor * xMax
104 or fabs(xMax - pdf->GetXaxis()->GetXmax()) > epsFactor * xMax
105 or fabs(yMin - pdf->GetYaxis()->GetXmin()) > epsFactor * yMax
106 or fabs(yMax - pdf->GetYaxis()->GetXmax()) > epsFactor * yMax) {
107 B2FATAL(
"PDF for PDG " << pdgCode <<
" has binning/dimensions differing from previous PDF.");
138 for (
int i = 1; i < 9; ++i) {
144 B2WARNING(
"No dE/dx mean parameters!");
145 for (
int i = 0; i < 15; ++i)
150 B2WARNING(
"No dE/dx sigma parameters!");
151 for (
int i = 0; i < 12; ++i)
157 B2WARNING(
"No hadron correction parameters!");
158 for (
int i = 0; i < 4; ++i)
166 if (!genfit::MaterialEffects::getInstance()->isInitialized()) {
167 B2FATAL(
"Need to have SetupGenfitExtrapolationModule in path before this one.");
195 for (
const auto& track :
m_tracks) {
196 std::shared_ptr<CDCDedxTrack> dedxTrack = std::make_shared<CDCDedxTrack>();
197 dedxTrack->m_track = mtrack++;
203 B2WARNING(
"No related fit for track ...");
218 dedxTrack->m_mcmass = mcpart->
getMass();
220 dedxTrack->m_motherPDG = mother ? mother->getPDG() : 0;
222 const ROOT::Math::XYZVector trueMomentum = mcpart->
getMomentum();
223 dedxTrack->m_pTrue = trueMomentum.R();
224 dedxTrack->m_cosThetaTrue = cos(trueMomentum.Theta());
227 dedxTrack->m_pdg = -999;
231 const ROOT::Math::XYZVector& trackMom = fitResult->
getMomentum();
232 dedxTrack->m_p = trackMom.R();
233 bool nomom = (dedxTrack->m_p != dedxTrack->m_p);
237 costh = cos(trackMom.Theta());
240 dedxTrack->m_cosTheta = costh;
241 dedxTrack->m_charge = charge;
243 double injring = -1.0, injtime = -1.0;
245 if (m_TTDInfo.
isValid() && m_TTDInfo->hasInjection()) {
246 injring = m_TTDInfo->isHER();
247 injtime = m_TTDInfo->getTimeSinceLastInjectionInMicroSeconds();
249 dedxTrack->m_injring = injring;
250 dedxTrack->m_injtime = injtime;
255 B2WARNING(
"No related track for this fit...");
261 B2ERROR(
"GFTrack is pruned, please run CDCDedxPID only on unpruned tracks! Skipping this track.");
278 if ((abs(costh + 0.860) < 0.010) || (abs(costh - 0.955) <= 0.005))isEdge =
true;
281 bool isvalidTime =
true;
282 if (injtime < 0 || injring < 0)isvalidTime =
false;
287 double layerdE = 0.0;
288 double layerdx = 0.0;
290 int nhitscombined = 0;
291 int wirelongesthit = 0;
292 double longesthit = 0;
297 const std::vector< genfit::AbsTrackRep* >& gftrackRepresentations = recoTrack->
getRepresentations();
299 for (std::vector< genfit::TrackPoint* >::const_iterator tp = gftrackPoints.begin();
300 tp != gftrackPoints.end(); ++tp) {
305 if (!cdcRecoHit)
continue;
307 if (!cdcHit)
continue;
313 B2DEBUG(29,
"No fitter info, skipping...");
324 int foundByTrackFinder = 0;
329 double weightPionHypo = 0;
330 double weightProtHypo = 0;
331 double weightKaonHypo = 0;
333 for (std::vector<genfit::AbsTrackRep* >::const_iterator trep = gftrackRepresentations.begin();
334 trep != gftrackRepresentations.end(); ++trep) {
335 const int pdgCode = TMath::Abs((*trep)->getPDG());
341 if (kalmanFitterInfo == NULL) {
347 std::vector<double> weights = kalmanFitterInfo->
getWeights();
348 const double maxWeight = weights[0] > weights[1] ? weights[0] : weights[1];
349 if (pdgCode ==
Const::pion.getPDGCode()) weightPionHypo = maxWeight;
350 else if (pdgCode ==
Const::kaon.getPDGCode()) weightKaonHypo = maxWeight;
351 else if (pdgCode ==
Const::proton.getPDGCode()) weightProtHypo = maxWeight;
356 int currentLayer = (superlayer == 0) ? layer : (8 + (superlayer - 1) * 6 + layer);
357 int nextLayer = currentLayer;
360 const int iwire = (superlayer == 0) ? 160 * layer + wire :
m_nLayerWires[superlayer - 1] + (160 + 32 *
361 (superlayer - 1)) * layer + wire;
364 const bool lastHit = (tp + 1 == gftrackPoints.end());
365 bool lastHitInCurrentLayer = lastHit;
371 if (!nextcdcRecoHit || !(cdcRecoHit->
getCDCHit()) || !((*(tp + 1))->getFitterInfo())) {
372 lastHitInCurrentLayer =
true;
376 const int nextILayer = nextcdcHit->
getILayer();
378 nextLayer = (nextSuperlayer == 0) ? nextILayer : (8 + (nextSuperlayer - 1) * 6 + nextILayer);
379 lastHitInCurrentLayer = (nextLayer != currentLayer);
385 const TVector3 wireDir = (wirePosB - wirePosF).
Unit();
393 double topHeight = outer - wirePosF.Perp();
394 double bottomHeight = wirePosF.Perp() - inner;
395 double cellHeight = topHeight + bottomHeight;
396 double topHalfWidth = M_PI * outer / nWires;
397 double bottomHalfWidth = M_PI * inner / nWires;
398 double cellHalfWidth = M_PI * wirePosF.Perp() / nWires;
413 const TVector3& pocaMom = mop.getMom();
414 if (tp == gftrackPoints.begin() || cdcMom == 0) {
415 cdcMom = pocaMom.Mag();
416 dedxTrack->m_pCDC = cdcMom;
419 dedxTrack->m_p = cdcMom;
428 B2Vector3D pocaOnWire = mop.getPlane()->getO();
431 B2Vector3D B2WireDoca = fittedPoca - pocaOnWire;
434 double doca = B2WireDoca.
Perp();
435 double phidiff = fittedPoca.
Phi() - pocaOnWire.
Phi();
438 if (phidiff > -3.1416 && (phidiff < 0 || phidiff > 3.1416)) doca *= -1;
441 const double px = pocaMom.X();
442 const double py = pocaMom.Y();
443 const double wx = pocaOnWire.
X();
444 const double wy = pocaOnWire.
Y();
445 const double cross = wx * py - wy * px;
446 const double dot = wx * px + wy * py;
447 double entAng = atan2(cross,
dot);
450 double cellR = 2 * cellHalfWidth / cellHeight;
452 if (std::abs(2 *
atan(1) - std::abs(entAng)) < 0.01)tana = 100 * (entAng / std::abs(entAng));
454 double docaRS = doca *
std::sqrt((1 + cellR * cellR * tana * tana) / (1 + tana * tana));
455 double entAngRS =
std::atan(tana / cellR);
460 && numMCParticles == 0) ?
m_DBNonlADC->getCorrectedADC(adcbaseCount, currentLayer) : adcbaseCount;
462 double hitCharge = translator.
getCharge(adcCount, wireID,
false, pocaOnWire.
Z(), pocaMom.Phi());
466 double dadcCount = 1.0 * adcCount;
467 if (dedxTrack->m_scale != 0) dadcCount /= dedxTrack->m_scale;
470 double driftDRealistic = realistictdc.
getDriftLength(driftT, wireID, 0,
true, pocaOnWire.
Z(), pocaMom.Phi(), pocaMom.Theta());
471 double driftDRealisticRes = realistictdc.
getDriftLengthResolution(driftDRealistic, wireID,
true, pocaOnWire.
Z(), pocaMom.Phi(),
475 double celldx = c.dx(doca, entAng);
481 double normDocaRS = docaRS / cellHalfWidth;
483 && numMCParticles == 0) ?
m_DB2DCell->getMean(currentLayer, normDocaRS, entAngRS) : 1.0;
491 double correction = dedxTrack->m_runGain * dedxTrack->m_cosCor * dedxTrack->m_cosEdgeCor * dedxTrack->m_timeGain * wiregain *
497 if (correction != 0) dadcCount = dadcCount / correction;
500 double cellDedx = (dadcCount / celldx);
504 else cellDedx *= std::sin(trackMom.Theta());
507 dedxTrack->addHit(wire, iwire, currentLayer, doca, docaRS, entAng, entAngRS,
508 adcCount, adcbaseCount, hitCharge, celldx, cellDedx, cellHeight, cellHalfWidth, driftT,
509 driftDRealistic, driftDRealisticRes, wiregain, twodcor, onedcor,
510 foundByTrackFinder, weightPionHypo, weightKaonHypo, weightProtHypo);
515 if (correction != 0) {
517 layerdE += dadcCount;
520 if (celldx > longesthit) {
522 wirelongesthit = iwire;
528 B2WARNING(
"Track: " << mtrack <<
": genfit::MeasuredStateOnPlane exception...");
533 if (lastHitInCurrentLayer) {
535 double totalDistance;
537 else totalDistance = layerdx / std::sin(trackMom.Theta());
538 double layerDedx = layerdE / totalDistance;
542 dedxTrack->addDedx(nhitscombined, wirelongesthit, currentLayer, totalDistance, layerDedx);
546 saveLookupLogl(dedxTrack->m_cdcLogl, dedxTrack->m_pCDC, layerDedx);
563 if (dedxTrack->m_lDedx.empty()) {
564 B2DEBUG(29,
"Found track with no hits, ignoring.");
568 const int numDedx = dedxTrack->m_lDedx.size();
572 dedxTrack->m_lNHitsUsed = highEdgeTrunc - lowEdgeTrunc;
582 &(dedxTrack->m_dedxAvgTruncatedNoSat),
583 &(dedxTrack->m_dedxAvgTruncatedErr),
587 if (numMCParticles == 0)
588 dedxTrack->m_dedxAvgTruncated =
D2I(costh,
I2D(costh, 1.00) / 1.00 * dedxTrack->m_dedxAvgTruncatedNoSat);
589 else dedxTrack->m_dedxAvgTruncated = dedxTrack->m_dedxAvgTruncatedNoSat;
593 if (numMCParticles != 0 && dedxTrack->m_mcmass > 0 && dedxTrack->m_pTrue != 0) {
595 double mean =
getMean(dedxTrack->m_pCDC / dedxTrack->m_mcmass);
596 double sigma =
getSigma(mean, dedxTrack->m_lNHitsUsed,
597 dedxTrack->m_cosTheta, dedxTrack->m_timeReso);
598 dedxTrack->m_simDedx = gRandom->Gaus(mean, sigma);
599 while (dedxTrack->m_simDedx < 0)
600 dedxTrack->m_simDedx = gRandom->Gaus(mean, sigma);
602 dedxTrack->m_dedxAvgTruncated = dedxTrack->m_simDedx;
606 saveChiValue(dedxTrack->m_cdcChi, dedxTrack->m_predmean, dedxTrack->m_predres, dedxTrack->m_pCDC, dedxTrack->m_dedxAvgTruncated,
607 dedxTrack->m_cosTheta, dedxTrack->m_lNHitsUsed, dedxTrack->m_timeReso);
609 saveLookupLogl(dedxTrack->m_cdcLogl, dedxTrack->m_pCDC, dedxTrack->m_dedxAvgTruncated);
617 pidvalues[pdgIter.getIndex()] = -0.5 * dedxTrack->m_cdcChi[pdgIter.getIndex()] * dedxTrack->m_cdcChi[pdgIter.getIndex()];
621 pidvalues[pdgIter.getIndex()] = dedxTrack->m_cdcLogl[pdgIter.getIndex()];
626 track.addRelationTo(likelihoodObj);
631 track.addRelationTo(newCDCDedxTrack);
640 B2DEBUG(29,
"CDCDedxPIDModule exiting");
644 const std::vector<double>& dedx)
const
648 std::vector<double> sortedDedx = dedx;
649 std::sort(sortedDedx.begin(), sortedDedx.end());
650 sortedDedx.erase(std::remove(sortedDedx.begin(), sortedDedx.end(), 0), sortedDedx.end());
651 sortedDedx.shrink_to_fit();
653 double truncatedMeanTmp = 0.0;
654 double meanTmp = 0.0;
655 double sumOfSquares = 0.0;
656 int numValuesTrunc = 0;
657 const int numDedx = sortedDedx.size();
662 for (
int i = 0; i < numDedx; i++) {
663 meanTmp += sortedDedx[i];
664 if (i >= lowEdgeTrunc and i < highEdgeTrunc) {
665 truncatedMeanTmp += sortedDedx[i];
666 sumOfSquares += sortedDedx[i] * sortedDedx[i];
674 if (numValuesTrunc != 0) {
675 truncatedMeanTmp /= numValuesTrunc;
677 truncatedMeanTmp = meanTmp;
681 *truncatedMean = truncatedMeanTmp;
683 if (numValuesTrunc > 1) {
684 *truncatedMeanErr =
sqrt(sumOfSquares /
double(numValuesTrunc) - truncatedMeanTmp * truncatedMeanTmp) / double(
687 *truncatedMeanErr = 0;
695 const Int_t binX = pdf->GetXaxis()->FindFixBin(p);
696 const Int_t binY = pdf->GetYaxis()->FindFixBin(dedx);
700 if (pdf->GetEntries() == 0) {
701 B2WARNING(
"NO CDC PDFS...");
704 double probability = 0.0;
707 if (binX < 1 or binX > pdf->GetNbinsX()
708 or binY < 1 or binY > pdf->GetNbinsY()) {
709 probability = pdf->GetBinContent(binX, binY);
714 probability =
const_cast<TH2F*
>(pdf)->Interpolate(p, dedx);
717 if (probability != probability)
718 B2ERROR(
"probability NAN for a track with p=" << p <<
" and dedx=" << dedx);
721 if (probability == 0.0)
723 logl[iPart] += log(probability);
729 double absCosTheta = fabs(cosTheta);
731 if (projection == 0) {
732 B2WARNING(
"Something wrong with dE/dx hadron constants!");
736 double chargeDensity = D / projection;
738 double denominator = 1 +
m_hadronpars[1] * chargeDensity;
740 if (denominator == 0) {
741 B2WARNING(
"Something wrong with dE/dx hadron constants!");
745 double I = D *
m_hadronpars[4] * numerator / denominator;
751 double absCosTheta = fabs(cosTheta);
755 B2WARNING(
"Something wrong with dE/dx hadron constants!");
763 if (b == 0 && a == 0) {
764 B2WARNING(
"both a and b coefficiants for hadron correction are 0");
768 double discr = b * b - 4.0 * a * c;
770 B2WARNING(
"negative discriminant; return uncorrectecd value");
774 double D = (a != 0) ? (-b +
sqrt(discr)) / (2.0 * a) : -c / b;
776 B2WARNING(
"D is less 0! will try another solution");
777 D = (a != 0) ? (-b -
sqrt(discr)) / (2.0 * a) : -c / b;
779 B2WARNING(
"D is still less 0! just return uncorrectecd value");
795 f = par[1] * std::pow(
std::sqrt(x[0] * x[0] + 1), par[3]) / std::pow(x[0], par[3]) *
796 (par[2] - par[5] * std::log(1 / x[0])) - par[4] + std::exp(par[6] + par[7] * x[0]);
797 else if (par[0] == 2)
798 f = par[1] * std::pow(x[0], 3) + par[2] * x[0] * x[0] + par[3] * x[0] + par[4];
799 else if (par[0] == 3)
800 f = -1.0 * par[1] * std::log(par[4] + std::pow(1 / x[0], par[2])) + par[3];
809 double A = 0, B = 0, C = 0;
817 double x[1]; x[0] = bg;
822 parsA[0] = 1; parsB[0] = 2; parsC[0] = 3;
823 for (
int i = 0; i < 15; ++i) {
825 else if (i < 11) parsB[i % 7 + 1] =
m_meanpars[i];
834 return (A * partA + B * partB + C * partC);
845 f = par[1] + par[2] * x[0];
846 }
else if (par[0] == 2) {
847 f = par[1] * std::pow(x[0], 4) + par[2] * std::pow(x[0], 3) +
848 par[3] * x[0] * x[0] + par[4] * x[0] + par[5];
849 }
else if (par[0] == 3) {
850 f = par[1] * exp(-0.5 * pow(((x[0] - par[2]) / par[3]), 2)) +
851 par[4] * pow(x[0], 6) + par[5] * pow(x[0], 5) + par[6] * pow(x[0], 4) +
852 par[7] * pow(x[0], 3) + par[8] * x[0] * x[0] + par[9] * x[0] + par[10];
868 dedxpar[0] = 1; nhitpar[0] = 2; cospar[0] = 3;
869 for (
int i = 0; i < 10; ++i) {
881 int nhit_min = 8, nhit_max = 37;
883 if (nhit < nhit_min) {
886 }
else if (nhit > nhit_max) {
894 return (corDedx * corCos * corNHit * timereso);
899 double cos,
int nhit,
double timereso)
const
904 double bg = p / pdgIter.getMass();
908 double sigma =
getSigma(mean, nhit, cos, timereso);
910 predmean[pdgIter.getIndex()] = mean;
911 predsigma[pdgIter.getIndex()] = sigma;
914 if (sigma != 0) chi[pdgIter.getIndex()] = ((dedx - mean) / (sigma));
DataType Phi() const
The azimuth angle.
DataType Z() const
access variable Z (= .at(2) without boundary check)
DataType X() const
access variable X (= .at(0) without boundary check)
DataType Y() const
access variable Y (= .at(1) without boundary check)
DataType Perp() const
The transverse component (R in cylindrical coordinate system).
Container for likelihoods obtained by the CDC dE/dx PID (CDCDedxPIDModule).
double I2D(double cosTheta, double I) const
hadron saturation parameterization part 1
double D2I(double cosTheta, double D) const
hadron saturation parameterization part 2
double getMean(double bg) const
calculate the predicted mean using the parameterized resolution
virtual ~CDCDedxPIDModule()
Destructor.
std::vector< double > m_hadronpars
hadron saturation parameters
DBObjPtr< CDCDedxRunGain > m_DBRunGain
Run gain DB object.
double sigmaCurve(double *x, const double *par, int version) const
parameterized resolution for predictions
DBObjPtr< CDCDedxMeanPars > m_DBMeanPars
dE/dx mean parameters
virtual void initialize() override
Initialize the module.
DBObjPtr< CDCDedxHadronCor > m_DBHadronCor
hadron saturation parameters
virtual void event() override
This method is called for each event.
double m_removeHighest
Portion of highest dE/dx values that should be discarded for truncated mean.
StoreArray< CDCDedxLikelihood > m_dedxLikelihoods
Output array of CDCDedxLikelihoods.
DBObjPtr< CDCDedxCosineEdge > m_DBCosEdgeCor
non-lineary ACD correction DB object
StoreArray< MCParticle > m_mcparticles
Optional array of input MCParticles.
void saveLookupLogl(double(&logl)[Const::ChargedStable::c_SetSize], double p, double dedx)
for all particles, save log-likelihood values into 'logl'.
DBObjPtr< CDCDedxADCNonLinearity > m_DBNonlADC
non-lineary ACD correction DB object
DBObjPtr< CDCDedx1DCell > m_DB1DCell
1D correction DB object
void checkPDFs()
Check the pdfs for consistency everytime they change in the database.
virtual void terminate() override
End of the event processing.
void saveChiValue(double(&chi)[Const::ChargedStable::c_SetSize], double(&predmean)[Const::ChargedStable::c_SetSize], double(&predres)[Const::ChargedStable::c_SetSize], double p, double dedx, double cos, int nhit, double timereso) const
for all particles, save chi values into 'chi'.
double meanCurve(double *x, double *par, int version) const
parameterized beta-gamma curve for predicted means
std::vector< double > m_sigmapars
dE/dx resolution parameters
void calculateMeans(double *mean, double *truncatedMean, double *truncatedMeanErr, const std::vector< double > &dedx) const
Save arithmetic and truncated mean for the 'dedx' values.
DBObjPtr< CDCDedx2DCell > m_DB2DCell
2D correction DB object
double getSigma(double dedx, double nhit, double cos, double timereso) const
calculate the predicted resolution using the parameterized resolution
DBObjPtr< CDCDedxCosineCor > m_DBCosineCor
Electron saturation correction DB object.
bool m_ignoreMissingParticles
Ignore particles for which no PDFs are found.
StoreArray< Track > m_tracks
Required array of input Tracks.
int m_nLayerWires[9]
number of wires per layer: needed for wire gain calibration
CDCDedxPIDModule()
Default constructor.
bool m_onlyPrimaryParticles
Only save data for primary particles (as determined by MC truth)
DBObjPtr< CDCDedxSigmaPars > m_DBSigmaPars
dE/dx resolution parameters
DBObjPtr< CDCDedxWireGain > m_DBWireGains
Wire gain DB object.
std::vector< double > m_meanpars
dE/dx mean parameters
bool m_backHalfCurlers
Whether to use the back half of curlers.
bool m_trackLevel
Whether to use track-level or hit-level MC.
StoreArray< RecoTrack > m_recoTracks
Required array of input RecoTracks.
bool m_useIndividualHits
Include PDF value for each hit in likelihood.
bool m_usePrediction
Whether to use parameterized means and resolutions or lookup tables.
double m_removeLowest
Portion of lowest dE/dx values that should be discarded for truncated mean.
StoreArray< CDCDedxTrack > m_dedxTracks
Output array of CDCDedxTracks.
bool m_enableDebugOutput
Whether to save information on tracks and associated hits and dE/dx values in DedxTrack objects.
DBObjPtr< CDCDedxInjectionTime > m_DBInjectTime
time gain/reso DB object
DBObjPtr< CDCDedxScaleFactor > m_DBScaleFactor
Scale factor to make electrons ~1.
DBObjPtr< DedxPDFs > m_DBDedxPDFs
DB object for dedx:momentum PDFs.
Debug output for CDCDedxPID module.
Class containing the result of the unpacker in raw data and the result of the digitizer in simulation...
short getTDCCount() const
Getter for TDC count.
unsigned short getADCCount() const
Getter for integrated charge.
unsigned short getISuperLayer() const
Getter for iSuperLayer.
unsigned short getILayer() const
Getter for iLayer.
This class is used to transfer CDC information to the track fit.
const CDCHit * getCDCHit() const
get the pointer to the CDCHit object that was used to create this CDCRecoHit object.
WireID getWireID() const
Getter for WireID object.
The Class for CDC Geometry Parameters.
const B2Vector3D wireForwardPosition(uint layerId, int cellId, EWirePosition set=c_Base) const
Returns the forward position of the input sense wire.
const B2Vector3D wireBackwardPosition(uint layerId, int cellId, EWirePosition set=c_Base) const
Returns the backward position of the input sense wire.
unsigned nWiresInLayer(int layerId) const
Returns wire numbers in a layer.
const double * innerRadiusWireLayer() const
Returns an array of inner radius of wire layers.
static CDCGeometryPar & Instance(const CDCGeometry *=nullptr)
Static method to get a reference to the CDCGeometryPar instance.
const double * outerRadiusWireLayer() const
Returns an array of outer radius of wire layers.
This class simply assumes a linear translation through (0,0)
float getCharge(unsigned short adcCount, const WireID &, bool, float, float)
just multiply with the conversion factor and return.
Translator mirroring the realistic Digitization.
double getDriftLength(unsigned short tdcCount, const WireID &wireID=WireID(), double timeOfFlightEstimator=0, bool leftRight=false, double z=0, double alpha=0, double theta=static_cast< double >(TMath::Pi()/2.), unsigned short adcCount=0) override
Get Drift length.
double getDriftLengthResolution(double driftLength, const WireID &wireID=WireID(), bool leftRight=false, double z=0, double alpha=0, double=static_cast< double >(TMath::Pi()/2.)) override
Get position resolution^2 corresponding to the drift length from getDriftLength of this class.
Provides a type-safe way to pass members of the chargedStableSet set.
static const unsigned int c_SetSize
Number of elements (for use in array bounds etc.)
A set of ParticleType objects, with defined order.
const ParticleType & at(unsigned int index) const
Return particle at given index, or end() if out of range.
int getPDGCode() const
PDG code.
static const ParticleSet chargedStableSet
set of charged stable particles
static const ChargedStable pion
charged pion particle
static const ChargedStable proton
proton particle
static const ChargedStable kaon
charged kaon particle
A class to hold the geometry of a cell.
A collection of classes that are useful for making a simple path length correction to the dE/dx measu...
A Class to store the Monte Carlo particle information.
@ c_PrimaryParticle
bit 0: Particle is primary particle.
float getMass() const
Return the particle mass in GeV.
bool hasStatus(unsigned short int bitmask) const
Return if specific status bit is set.
int m_pdg
PDG-Code of the particle.
int getPDG() const
Return PDG code of particle.
ROOT::Math::XYZVector getMomentum() const
Return momentum.
void setDescription(const std::string &description)
Sets the description of the module.
void setPropertyFlags(unsigned int propertyFlags)
Sets the flags for the module properties.
@ c_ParallelProcessingCertified
This module can be run in parallel processing mode safely (All I/O must be done through the data stor...
This is the Reconstruction Event-Data Model Track.
const genfit::FitStatus * getTrackFitStatus(const genfit::AbsTrackRep *representation=nullptr) const
Return the track fit status for the given representation or for the cardinal one. You are not allowed...
const std::vector< genfit::TrackPoint * > & getHitPointsWithMeasurement() const
Return a list of measurements and track points, which can be used e.g. to extrapolate....
const std::vector< genfit::AbsTrackRep * > & getRepresentations() const
Return a list of track representations. You are not allowed to modify or delete them!
RecoHitInformation * getRecoHitInformation(HitType *hit) const
Return the reco hit information for a generic hit from the storeArray.
bool isRequired(const std::string &name="")
Ensure this array/object has been registered previously.
bool isOptional(const std::string &name="")
Tell the DataStore about an optional input.
int getEntries() const
Get the number of objects in the array.
Type-safe access to single objects in the data store.
bool isValid() const
Check whether the object was created.
Values of the result of a track fit with a given particle hypothesis.
short getChargeSign() const
Return track charge (1 or -1).
double getCotTheta() const
Getter for tanLambda with CDF naming convention.
ROOT::Math::XYZVector getMomentum() const
Getter for vector of momentum at closest approach of track in r/phi projection.
Class to identify a wire inside the CDC.
unsigned short getIWire() const
Getter for wire within the layer.
This class collects all information needed and produced by a specific AbsFitter and is specific to on...
Contains the measurement and covariance in raw detector coordinates.
Exception class for error handling in GENFIT (provides storage for diagnostic information)
bool isTrackPruned() const
Has the track been pruned after the fit?
Collects information needed and produced by a AbsKalmanFitter implementations and is specific to one ...
std::vector< double > getWeights() const
Get weights of measurements.
#StateOnPlane with additional covariance matrix.
REG_MODULE(arichBtest)
Register the Module.
void addParam(const std::string &name, T ¶mVariable, const std::string &description, const T &defaultValue)
Adds a new parameter to the module.
double sqrt(double a)
sqrt for double
double atan(double a)
atan for double
T dot(GeneralVector< T > a, GeneralVector< T > b)
dot product of two general vectors
double tan(double a)
tan for double
MCParticle * getMother() const
Returns a pointer to the mother particle.
Abstract base class for different kinds of events.