Commit 449adc1f authored by Daniel Hynds's avatar Daniel Hynds
Browse files

added search for missing hits during efficiency calculation


Former-commit-id: 9773055d140f9adb74ff6911f1e1dcec32489a38
parent 3e2a920a
...@@ -6,7 +6,7 @@ ...@@ -6,7 +6,7 @@
ClicpixAnalysis::ClicpixAnalysis(bool debugging) ClicpixAnalysis::ClicpixAnalysis(bool debugging)
: Algorithm("ClicpixAnalysis"){ : Algorithm("ClicpixAnalysis"){
debug = debugging; debug = debugging;
m_associationCut = 0.3; // 300 um m_associationCut = 0.1; // 100 um
m_proximityCut = 0.125; // 125 um m_proximityCut = 0.125; // 125 um
} }
...@@ -114,7 +114,7 @@ void ClicpixAnalysis::initialise(Parameters* par){ ...@@ -114,7 +114,7 @@ void ClicpixAnalysis::initialise(Parameters* par){
hInterceptClusterSize4 = new TH2F("hInterceptClusterSize4","hInterceptClusterSize4",50,0,50,25,0,25); hInterceptClusterSize4 = new TH2F("hInterceptClusterSize4","hInterceptClusterSize4",50,0,50,25,0,25);
// Initialise member variables // Initialise member variables
m_eventNumber = 0; m_triggerNumber = 0; dutID = parameters->DUT; m_eventNumber = 0; m_triggerNumber = 0; dutID = parameters->DUT; m_lostHits = 0.;
} }
...@@ -275,23 +275,26 @@ StatusCode ClicpixAnalysis::run(Clipboard* clipboard){ ...@@ -275,23 +275,26 @@ StatusCode ClicpixAnalysis::run(Clipboard* clipboard){
hInterceptClusterSize4->Fill(pixelInterceptX,pixelInterceptY); hInterceptClusterSize4->Fill(pixelInterceptX,pixelInterceptY);
} }
}else{ }else{
/*
// Search for lost hits. Basically loop through all pixels in all clusters and see if any are close // Search for lost hits. Basically loop through all pixels in all clusters and see if any are close.
// Large clusters (such as from deltas) can pull the cluster centre sufficiently far from the track
bool pixelMatch = false; int size=0; bool pixelMatch = false; int size=0;
for (itc = clusters->begin(); itc != clusters->end(); ++itc) { for (itCorrelate = clusters->begin(); itCorrelate != clusters->end(); ++itCorrelate) {
if (!(*itc)) continue; //if(matched) continue; if(pixelMatch) break;
string chip = (*itc)->detectorId();
// Only look at the clicpix
if(chip != "CLi-CPix") continue;
// Loop over pixels // Loop over pixels
vector<RowColumnEntry*>::const_iterator ith; Pixels::const_iterator itPixel;
for (ith = (*itc)->hits()->begin(); ith != (*itc)->hits()->end(); ++ith) { for (itPixel = (*itCorrelate)->pixels().begin(); itPixel != (*itCorrelate)->pixels().end(); itPixel++) {
// Get the pixel global position
PositionVector3D<Cartesian3D<double> > pixelPositionLocal = parameters->detector[dutID]->getLocalPosition((*itPixel)->m_row,(*itPixel)->m_column);
PositionVector3D<Cartesian3D<double> > pixelPositionGlobal = *(parameters->detector[dutID]->m_localToGlobal) * pixelPositionLocal;
// Check if this pixel is within the search window // Check if it is close to the track
if( fabs((*ith)->column()-chipInterceptCol) > (residualmaxx/parameters->pixelPitchX["CLi-CPix"]) || if( fabs( pixelPositionGlobal.X() - trackIntercept.X() ) > m_associationCut ||
fabs((*ith)->row()-chipInterceptRow) > (residualmaxy/parameters->pixelPitchY["CLi-CPix"]) ) continue; fabs( pixelPositionGlobal.Y() - trackIntercept.Y() ) > m_associationCut ) continue;
pixelMatch=true; pixelMatch=true;
break;
} }
} }
// Increment counter for number of hits found this way // Increment counter for number of hits found this way
...@@ -299,7 +302,6 @@ StatusCode ClicpixAnalysis::run(Clipboard* clipboard){ ...@@ -299,7 +302,6 @@ StatusCode ClicpixAnalysis::run(Clipboard* clipboard){
m_lostHits++; m_lostHits++;
hTrackInterceptsChipLost->Fill(chipInterceptCol,chipInterceptRow); hTrackInterceptsChipLost->Fill(chipInterceptCol,chipInterceptRow);
} }
*/
} }
} }
...@@ -331,9 +333,8 @@ void ClicpixAnalysis::finalise(){ ...@@ -331,9 +333,8 @@ void ClicpixAnalysis::finalise(){
tcout<<"***** Clicpix efficiency calculation *****"<<endl; tcout<<"***** Clicpix efficiency calculation *****"<<endl;
tcout<<"***** ntracks: "<<(int)nTracks<<", nclusters "<<(int)nClusters<<endl; tcout<<"***** ntracks: "<<(int)nTracks<<", nclusters "<<(int)nClusters<<endl;
tcout<<"***** Efficiency: "<<100.*efficiency<<" +/- "<<100.*errorEfficiency<<" %"<<endl; tcout<<"***** Efficiency: "<<100.*efficiency<<" +/- "<<100.*errorEfficiency<<" %"<<endl;
tcout<<"***** If including the "<<(int)m_lostHits<<" lost pixel hits, this becomes "<<100.*(m_lostHits+nClusters)/nTracks<<" %"<<endl;
tcout<<endl; tcout<<endl;
// tcout<<"***** If including the "<<(int)m_lostHits<<" lost pixel hits, this becomes "<<100.*(m_lostHits+nClusters)/nTracks<<" %"<<endl;
} }
......
...@@ -114,6 +114,7 @@ public: ...@@ -114,6 +114,7 @@ public:
map<int,double> m_hitPixels; map<int,double> m_hitPixels;
double m_associationCut; double m_associationCut;
double m_proximityCut; double m_proximityCut;
double m_lostHits;
}; };
......
Supports Markdown
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