Commit fe119953 authored by Katharina Dort's avatar Katharina Dort
Browse files

Added cut flow histograms to AnalysisDUT

parent fc4411ef
......@@ -104,7 +104,15 @@ void AnalysisDUT::initialise() {
auto pitch_y = static_cast<double>(Units::convert(m_detector->pitch().Y(), "um"));
auto mod_axes = "x_{track} mod " + std::to_string(pitch_x) + "#mum;y_{track} mod " + std::to_string(pitch_y) + "#mum;";
std::string title = "DUT x resolution;" + mod_axes + "MAD(#Deltax) [#mum]";
// cut flow histogram
std::string title = m_detector->name() + ": number of tracks discarded by cut;cut type;events";
hCutHisto = new TH1F("hCutHisto", title.c_str(), 4, 1, 5);
hCutHisto->GetXaxis()->SetBinLabel(1,"Chi2");
hCutHisto->GetXaxis()->SetBinLabel(2,"Outside DUT");
hCutHisto->GetXaxis()->SetBinLabel(3,"Close to masked pixel");
hCutHisto->GetXaxis()->SetBinLabel(4,"Close to frame begin/end");
title = "DUT x resolution;" + mod_axes + "MAD(#Deltax) [#mum]";
rmsxvsxmym = new TProfile2D(
"rmsxvsxmym", title.c_str(), static_cast<int>(pitch_x), 0, pitch_x, static_cast<int>(pitch_y), 0, pitch_y);
......@@ -265,6 +273,7 @@ StatusCode AnalysisDUT::run(std::shared_ptr<Clipboard> clipboard) {
// Cut on the chi2/ndof
if(track->chi2ndof() > chi2ndofCut) {
LOG(DEBUG) << " - track discarded due to Chi2/ndof";
hCutHisto->Fill(1);
continue;
}
......@@ -274,6 +283,7 @@ StatusCode AnalysisDUT::run(std::shared_ptr<Clipboard> clipboard) {
if(!m_detector->hasIntercept(track, 0.5)) {
LOG(DEBUG) << " - track outside DUT area";
hCutHisto->Fill(2);
continue;
}
......@@ -285,6 +295,7 @@ StatusCode AnalysisDUT::run(std::shared_ptr<Clipboard> clipboard) {
// Check that it doesn't go through/near a masked pixel
if(m_detector->hitMasked(track, 1.)) {
LOG(DEBUG) << " - track close to masked pixel";
hCutHisto->Fill(3);
continue;
}
......@@ -297,12 +308,14 @@ StatusCode AnalysisDUT::run(std::shared_ptr<Clipboard> clipboard) {
LOG(DEBUG) << " - track close to end of readout frame: "
<< Units::display(fabs(track->timestamp() - event->end()), {"us", "ns"}) << " at "
<< Units::display(track->timestamp(), {"us"});
hCutHisto->Fill(4);
continue;
} else if(fabs(track->timestamp() - event->start()) < m_timeCutFrameEdge) {
// Early edge - eventStart points to the beginning of the frame
LOG(DEBUG) << " - track close to start of readout frame: "
<< Units::display(fabs(track->timestamp() - event->start()), {"us", "ns"}) << " at "
<< Units::display(track->timestamp(), {"us"});
hCutHisto->Fill(4);
continue;
}
......
......@@ -44,6 +44,8 @@ namespace corryvreckan {
TH1F* clusterSizeAssoc;
TH1F* clusterSizeAssocNorm;
TH1F* hCutHisto;
TProfile2D *rmsxvsxmym, *rmsyvsxmym, *rmsxyvsxmym;
TProfile2D *qvsxmym, *qMoyalvsxmym, *pxqvsxmym;
TProfile2D* npxvsxmym;
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment