Commit 36978bf2 authored by Daniel Hynds's avatar Daniel Hynds
Browse files

added histograms for different cluster size, fixed issue with no reference clusters causing crash

parent c18c8b2f
......@@ -32,8 +32,20 @@ void BasicTracking::initialise() {
continue;
string name = "residualsX_" + detectorID;
residualsX[detectorID] = new TH1F(name.c_str(), name.c_str(), 100, -0.02, 0.02);
name = "residualsXwidth1_" + detectorID;
residualsXwidth1[detectorID] = new TH1F(name.c_str(), name.c_str(), 100, -0.02, 0.02);
name = "residualsXwidth2_" + detectorID;
residualsXwidth2[detectorID] = new TH1F(name.c_str(), name.c_str(), 100, -0.02, 0.02);
name = "residualsXwidth3_" + detectorID;
residualsXwidth3[detectorID] = new TH1F(name.c_str(), name.c_str(), 100, -0.02, 0.02);
name = "residualsY_" + detectorID;
residualsY[detectorID] = new TH1F(name.c_str(), name.c_str(), 100, -0.02, 0.02);
name = "residualsYwidth1_" + detectorID;
residualsYwidth1[detectorID] = new TH1F(name.c_str(), name.c_str(), 100, -0.02, 0.02);
name = "residualsYwidth2_" + detectorID;
residualsYwidth2[detectorID] = new TH1F(name.c_str(), name.c_str(), 100, -0.02, 0.02);
name = "residualsYwidth3_" + detectorID;
residualsYwidth3[detectorID] = new TH1F(name.c_str(), name.c_str(), 100, -0.02, 0.02);
}
}
......@@ -43,7 +55,7 @@ StatusCode BasicTracking::run(Clipboard* clipboard) {
// Container for all clusters, and detectors in tracking
map<string, KDTree*> trees;
vector<string> detectors;
Clusters* referenceClusters;
Clusters* referenceClusters = nullptr;
Clusters dutClusters;
// Output track container
......@@ -66,11 +78,12 @@ StatusCode BasicTracking::run(Clipboard* clipboard) {
} else {
// Store them
LOG(DEBUG) << "Picked up " << tempClusters->size() << " clusters from " << detectorID;
if(firstDetector) {
if(firstDetector && detectorID != m_config.get<std::string>("DUT")) {
referenceClusters = tempClusters;
seedPlane = detector->name();
seedPlane = detector->name();
LOG(DEBUG) << "Seed plane is "<<seedPlane;
firstDetector = false;
}
firstDetector = false;
if(tempClusters->size() == 0)
continue;
KDTree* clusterTree = new KDTree();
......@@ -85,6 +98,7 @@ StatusCode BasicTracking::run(Clipboard* clipboard) {
return Success;
// Loop over all clusters
if(referenceClusters == nullptr) return Success;
int nSeedClusters = referenceClusters->size();
map<Cluster*, bool> used;
for(auto& cluster : (*referenceClusters)) {
......@@ -185,7 +199,13 @@ StatusCode BasicTracking::run(Clipboard* clipboard) {
string detectorID = trackCluster->detectorID();
ROOT::Math::XYZPoint intercept = track->intercept(trackCluster->globalZ());
residualsX[detectorID]->Fill(intercept.X() - trackCluster->globalX());
if(trackCluster->columnWidth() == 1) residualsXwidth1[detectorID]->Fill(intercept.X() - trackCluster->globalX());
if(trackCluster->columnWidth() == 2) residualsXwidth2[detectorID]->Fill(intercept.X() - trackCluster->globalX());
if(trackCluster->columnWidth() == 3) residualsXwidth3[detectorID]->Fill(intercept.X() - trackCluster->globalX());
residualsY[detectorID]->Fill(intercept.Y() - trackCluster->globalY());
if(trackCluster->rowWidth() == 1) residualsYwidth1[detectorID]->Fill(intercept.Y() - trackCluster->globalY());
if(trackCluster->rowWidth() == 2) residualsYwidth2[detectorID]->Fill(intercept.Y() - trackCluster->globalY());
if(trackCluster->rowWidth() == 3) residualsYwidth3[detectorID]->Fill(intercept.Y() - trackCluster->globalY());
}
// Add potential associated clusters from the DUT:
......
......@@ -36,7 +36,13 @@ namespace corryvreckan {
TH1F* trackAngleX;
TH1F* trackAngleY;
std::map<std::string, TH1F*> residualsX;
std::map<std::string, TH1F*> residualsXwidth1;
std::map<std::string, TH1F*> residualsXwidth2;
std::map<std::string, TH1F*> residualsXwidth3;
std::map<std::string, TH1F*> residualsY;
std::map<std::string, TH1F*> residualsYwidth1;
std::map<std::string, TH1F*> residualsYwidth2;
std::map<std::string, TH1F*> residualsYwidth3;
// Cuts for tracking
double timingCut;
......
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