global variables setup to explore wire geometry

This commit is contained in:
Sudarsan Balakrishnan 2026-04-08 14:36:12 -04:00
parent 39f7f7da37
commit e61a63ea13
46 changed files with 493 additions and 127 deletions

0
Armory/ClassPW.h Executable file → Normal file
View File

View File

@ -36,7 +36,7 @@ private:
inline void FillN_All_Histograms(); inline void FillN_All_Histograms();
public: public:
HistPlotter(std::string outfile, std::string type); HistPlotter(std::string outfile, std::string type);
inline void FlushToDisk(); //!< Writes all objects to file before closing, nesting objects in folders as is found necessary inline void FlushToDisk(int integral); //!< Writes all objects to file before closing, nesting objects in folders as is found necessary
inline void PrintObjects(); //!< Dump objects to std::cout for inspection inline void PrintObjects(); //!< Dump objects to std::cout for inspection
inline void ReadCuts(std::string); inline void ReadCuts(std::string);
inline TCutG* FindCut(std::string cut) { inline TCutG* FindCut(std::string cut) {
@ -117,7 +117,8 @@ void HistPlotter::FillN_All_Histograms() {
} }
std::cout << "." << std::endl; std::cout << "." << std::endl;
} }
void HistPlotter::FlushToDisk() {
void HistPlotter::FlushToDisk(int min_integral=0) {
/*! \fn void FlushToDisk() /*! \fn void FlushToDisk()
\brief Function that can be used at any point to exit smoothly by saving all ROOT objects in memory \brief Function that can be used at any point to exit smoothly by saving all ROOT objects in memory
to the output file before closing it. Obeys the binding of histograms to separate folders, if so specified. to the output file before closing it. Obeys the binding of histograms to separate folders, if so specified.
@ -143,7 +144,8 @@ void HistPlotter::FlushToDisk() {
} else { } else {
ofile->cd(); //toplevel for all default histograms. Default setting ofile->cd(); //toplevel for all default histograms. Default setting
} }
it->second->Write(); if(((TH1F*)it->second)->Integral()>min_integral)
it->second->Write();
} }
//Create a directory for all cuts, and save all cuts in them //Create a directory for all cuts, and save all cuts in them

0
Armory/SX3Geom.h Executable file → Normal file
View File

133
MakeVertex.C Executable file → Normal file
View File

@ -36,10 +36,10 @@ Int_t colors[40] = {
#include <algorithm> #include <algorithm>
bool realtime = true; bool realtime = true;
const double source_vertex = 53; //53 double source_vertex = 53; //53
const double qqq_z = 100.0; const double qqq_z = 100.0;
const double anode_gain = 1.5146e-5; //channels --> MeV const double anode_gain = 1.5146e-5; //channels --> MeV
std::string dataset = "26Al"; //"17F" std::string dataset;
TApplication *app=NULL; TApplication *app=NULL;
TH1F *hha=NULL,*hhc=NULL; TH1F *hha=NULL,*hhc=NULL;
@ -124,6 +124,15 @@ void MakeVertex::Begin(TTree * /*tree*/)
pcIntercept[i] = 0.0; // Default intercept = 0 pcIntercept[i] = 0.0; // Default intercept = 0
} }
if(getenv("DATASET"))
dataset = std::string(getenv("DATASET"));
if(getenv("source_vertex"))
source_vertex = (double)std::atof(std::string(getenv("source_vertex")).c_str());
std::cout << "Dataset set to " << dataset << std::endl;
std::cout << "source_vertex set to " << source_vertex << std::endl;
fflush(stdout);
usleep(4e5);
// Load PC Calibrations // Load PC Calibrations
std::ifstream inputFile("slope_intercept_results_"+dataset+".txt"); std::ifstream inputFile("slope_intercept_results_"+dataset+".txt");
if (inputFile.is_open()) if (inputFile.is_open())
@ -322,7 +331,7 @@ Bool_t MakeVertex::Process(Long64_t entry)
try { try {
Fsx3.at(id).validate(); Fsx3.at(id).validate();
} catch(std::exception exc) { } catch(std::exception exc) {
std::cout << "oops! anyway" << std::endl; std::cout << "oops! anyway " << std::endl;
continue; continue;
} }
auto det = Fsx3.at(id); auto det = Fsx3.at(id);
@ -336,8 +345,6 @@ Bool_t MakeVertex::Process(Long64_t entry)
plotter->Fill2D("matched_be_vs_x_sx3_id_"+std::to_string(id)+"_f"+std::to_string(det.stripF),200,-30,30,800,0,8192, plotter->Fill2D("matched_be_vs_x_sx3_id_"+std::to_string(id)+"_f"+std::to_string(det.stripF),200,-30,30,800,0,8192,
det.frontX*sx3FrontGain[id][det.stripF]+sx3FrontOffset[id][det.stripF],det.backE*sx3BackGain[id][det.stripF][det.stripB],"evsx_matched"); det.frontX*sx3FrontGain[id][det.stripF]+sx3FrontOffset[id][det.stripF],det.backE*sx3BackGain[id][det.stripF][det.stripB],"evsx_matched");
//plotter->Fill2D("fe_vs_x_sx3_id_"+std::to_string(id)+"_f"+std::to_string(det.stripF)+"_"+std::to_string(det.stripB),200,-1,1,800,0,4096,det.frontX,det.backE,"evsx"); //plotter->Fill2D("fe_vs_x_sx3_id_"+std::to_string(id)+"_f"+std::to_string(det.stripF)+"_"+std::to_string(det.stripB),200,-1,1,800,0,4096,det.frontX,det.backE,"evsx");
plotter->Fill2D("l_vs_r_sx3_id_"+std::to_string(id)+"_f"+std::to_string(det.stripF),800,0,4096,800,0,4096,det.frontEL,det.frontER,"l_vs_r"); plotter->Fill2D("l_vs_r_sx3_id_"+std::to_string(id)+"_f"+std::to_string(det.stripF),800,0,4096,800,0,4096,det.frontEL,det.frontER,"l_vs_r");
} }
if(det.valid && (id ==9 || id==7 || id == 1 || id==3) && det.stripF!=DEFAULT_NULL && det.stripB!=DEFAULT_NULL) { if(det.valid && (id ==9 || id==7 || id == 1 || id==3) && det.stripF!=DEFAULT_NULL && det.stripB!=DEFAULT_NULL) {
@ -347,7 +354,13 @@ Bool_t MakeVertex::Process(Long64_t entry)
double beta_n = 15.0 + TMath::ATan2((2*det.stripF-3)*40.30, 8.0*88.0*TMath::Cos(15.0*M_PI/180.0))*180./M_PI; //how much to add per strip to the starting position double beta_n = 15.0 + TMath::ATan2((2*det.stripF-3)*40.30, 8.0*88.0*TMath::Cos(15.0*M_PI/180.0))*180./M_PI; //how much to add per strip to the starting position
double phi_n = ((-id+0.5)*30+beta_n); double phi_n = ((-id+0.5)*30+beta_n);
phi_n+=45; phi_n+=45;
//phi_n-=120;
if(getenv("flip180")) {
if(std::string(getenv("flip180"))=="1") {
//if(dataset=="17F")
phi_n+=180;//run 37 in 17F-->
}
}
phi_n*=M_PI/180.; //starting-position phi + strip contribution phi_n*=M_PI/180.; //starting-position phi + strip contribution
Event sx3ev(TVector3(88.0*TMath::Cos(phi_n),88.0*TMath::Sin(phi_n),z),backE,-1,det.ts,-1,det.stripB+4*id,det.stripF+4*id); Event sx3ev(TVector3(88.0*TMath::Cos(phi_n),88.0*TMath::Sin(phi_n),z),backE,-1,det.ts,-1,det.stripB+4*id,det.stripF+4*id);
sx3Events.push_back(sx3ev); sx3Events.push_back(sx3ev);
@ -479,7 +492,8 @@ Bool_t MakeVertex::Process(Long64_t entry)
plotter->Fill2D("DelT_Vs_QQQRingECal", 500, -2000, 2000, 1000, 0, 10, tRing - static_cast<double>(pc.t[k]), eRingMeV, "hTiming"); plotter->Fill2D("DelT_Vs_QQQRingECal", 500, -2000, 2000, 1000, 0, 10, tRing - static_cast<double>(pc.t[k]), eRingMeV, "hTiming");
plotter->Fill2D("CalibratedQQQEvsPCE_R", 1000, 0, 10, 2000, 0, 30000, eRingMeV, pc.e[k], "hPCQQQ"); plotter->Fill2D("CalibratedQQQEvsPCE_R", 1000, 0, 10, 2000, 0, 30000, eRingMeV, pc.e[k], "hPCQQQ");
plotter->Fill2D("CalibratedQQQEvsPCE_W", 1000, 0, 10, 2000, 0, 30000, eWedgeMeV, pc.e[k], "hPCQQQ"); plotter->Fill2D("CalibratedQQQEvsPCE_W", 1000, 0, 10, 2000, 0, 30000, eWedgeMeV, pc.e[k], "hPCQQQ");
if (tRing - static_cast<double>(pc.t[k]) < -150) // proton tests, 27Al //if (tRing - static_cast<double>(pc.t[k]) < -150) // proton tests, 27Al
if (tRing - static_cast<double>(pc.t[k]) > 150) // proton tests, 27Al
{ {
PCAQQQTimeCut = true; PCAQQQTimeCut = true;
} }
@ -487,6 +501,8 @@ Bool_t MakeVertex::Process(Long64_t entry)
if (pc.index[k] >= 24 && pc.e[k] > 10) { if (pc.index[k] >= 24 && pc.e[k] > 10) {
if (tRing - static_cast<double>(pc.t[k]) < -200) PCCQQQTimeCut = true; if (tRing - static_cast<double>(pc.t[k]) < -200) PCCQQQTimeCut = true;
//if (tRing - static_cast<double>(pc.t[k]) > 200) PCCQQQTimeCut = true;
plotter->Fill2D("Timing_Difference_QQQ_PC_Cathode", 500, -2000, 2000, 16, 0, 16, tRing - static_cast<double>(pc.t[k]), chRing, "hTiming"); plotter->Fill2D("Timing_Difference_QQQ_PC_Cathode", 500, -2000, 2000, 16, 0, 16, tRing - static_cast<double>(pc.t[k]), chRing, "hTiming");
} }
} //end of pc k loop } //end of pc k loop
@ -547,18 +563,27 @@ Bool_t MakeVertex::Process(Long64_t entry)
{ {
anodeT = static_cast<double>(pc.t[i]); anodeT = static_cast<double>(pc.t[i]);
anodeIndex = pc.index[i]; anodeIndex = pc.index[i];
aWireEvents[pc.index[i]] = std::tuple(pc.index[i],pc.e[i],static_cast<double>(pc.t[i]));
if(getenv("flipa")) {
int flip_offset = std::atoi(getenv("flipa"));
int flipped_index = (anodeIndex+flip_offset)%24;
aWireEvents[flipped_index] = std::tuple(flipped_index,pc.e[i],static_cast<double>(pc.t[i]));
} else
aWireEvents[pc.index[i]] = std::tuple(pc.index[i],pc.e[i],static_cast<double>(pc.t[i]));
if(realtime) hha->SetBinContent(hha->FindFixBin(anodeIndex),pc.e[i]); if(realtime) hha->SetBinContent(hha->FindFixBin(anodeIndex),pc.e[i]);
} }
else else
{ {
cathodeT = static_cast<double>(pc.t[i]); cathodeT = static_cast<double>(pc.t[i]);
cathodeIndex = pc.index[i] - 24; cathodeIndex = pc.index[i] - 24;
if(getenv("flipc")) {
int flip_offset = std::atoi(getenv("flipc"));
int flipped_index = (cathodeIndex+flip_offset)%24;
cWireEvents[flipped_index] = std::tuple(flipped_index,pc.e[i],static_cast<double>(pc.t[i]));
} else {
cWireEvents[pc.index[i]-24] = std::tuple(pc.index[i]-24,pc.e[i],static_cast<double>(pc.t[i]));
}
//int flipped_index = 23-cathodeIndex;
//cWireEvents[flipped_index] = std::tuple(flipped_index,pc.e[i],static_cast<double>(pc.t[i]));
cWireEvents[pc.index[i]-24] = std::tuple(pc.index[i]-24,pc.e[i],static_cast<double>(pc.t[i]));
if(realtime) hhc->SetBinContent(hhc->FindFixBin(cathodeIndex),pc.e[i]); if(realtime) hhc->SetBinContent(hhc->FindFixBin(cathodeIndex),pc.e[i]);
} }
@ -577,6 +602,12 @@ Bool_t MakeVertex::Process(Long64_t entry)
{ {
plotter->Fill1D("PC_Time_sx3", 200, -2000, 2000, anodeT - cathodeT, "hTiming"); plotter->Fill1D("PC_Time_sx3", 200, -2000, 2000, anodeT - cathodeT, "hTiming");
} }
for(auto sx3event : sx3Events) {
bool TCC = sx3event.Time1 - cathodeT < 0;
bool TCA = sx3event.Time1 - anodeT < 0;
//plotter->Fill2D("sx3_z_phi_awire"+std::to_string(anodeIndex)+"_TC"+std::to_string(TCA), 400,-100,100, 200, -200,200,sx3event.pos.Z(), sx3event.pos.Phi()*180/M_PI );
//plotter->Fill2D("sx3_z_phi_cwire"+std::to_string(cathodeIndex)+"_TC"+std::to_string(TCC), 400,-100,100, 200, -200,200,sx3event.pos.Z(), sx3event.pos.Phi()*180/M_PI );
}
plotter->Fill1D("PC_Time", 200, -2000, 2000, anodeT - cathodeT, "hTiming"); plotter->Fill1D("PC_Time", 200, -2000, 2000, anodeT - cathodeT, "hTiming");
} }
@ -639,13 +670,36 @@ Bool_t MakeVertex::Process(Long64_t entry)
//Event PCEvent(crossover,apSumE,cpSumE,apTSMaxE,cpTSMaxE); //Event PCEvent(crossover,apSumE,cpSumE,apTSMaxE,cpTSMaxE);
Event PCEvent(crossover,apSumE,cpMaxE,apTSMaxE,cpTSMaxE); //run12 shows cathode-max and anode-sum provide best dE signals. Event PCEvent(crossover,apSumE,cpMaxE,apTSMaxE,cpTSMaxE); //run12 shows cathode-max and anode-sum provide best dE signals.
//std::cout << apSumE << " " << crossover.Perp() << " " << apMaxE << " " << apTSMaxE << std::endl; //std::cout << apSumE << " " << crossover.Perp() << " " << apMaxE << " " << apTSMaxE << std::endl;
//PCEvent.multi1=aCluster.size(); PCEvent.multi1=aCluster.size();
//PCEvent.multi2=cCluster.size(); PCEvent.multi2=cCluster.size();
PC_Events.push_back(PCEvent); PC_Events.push_back(PCEvent);
sumE_AC.push_back(std::pair(apSumE,cpSumE)); sumE_AC.push_back(std::pair(apSumE,cpSumE));
} }
} }
} }
for(auto sx3event: sx3Events) {
for(int i=0; i<24; i++) {
if(aWireEvents.find(i) != aWireEvents.end()) {
auto awire = aWireEvents[i];
if(sx3event.Time1 -(double)std::get<2>(awire)< -100) {
plotter->Fill2D("sx3_z_phi2_awire"+std::to_string(std::get<0>(awire)), 400,-100,100, 100, -200,200,sx3event.pos.Z(), sx3event.pos.Phi()*180/M_PI );
plotter->Fill2D("sx3_z_strip#_awire"+std::to_string(std::get<0>(awire)), 400,-100,100, 100, -50,50,sx3event.pos.Z(), sx3event.ch2);
//std::cout << sx3event.pos.Z() << " " << std::get<0>(awire) << " " << std::get<0>(awire) - sx3event.Time1 << std::endl;
}
}
if(cWireEvents.find(i) != cWireEvents.end()) {
auto cwire = cWireEvents[i];
if(sx3event.Time1 -(double)std::get<2>(cwire) < -100) {
plotter->Fill2D("sx3_z_phi2_cwire"+std::to_string(std::get<0>(cwire)),400,-100,100, 100, -200,200,sx3event.pos.Z(), sx3event.pos.Phi()*180/M_PI );
plotter->Fill2D("sx3_z_strip#_cwire"+std::to_string(std::get<0>(cwire)),400,-100,100, 100, -50,50,sx3event.pos.Z(), sx3event.ch2 );
}
}
}
}
if(QQQ_Events.size() && PC_Events.size()) if(QQQ_Events.size() && PC_Events.size())
plotter->Fill2D("PCEv_vs_QQQEv",20,0,20,20,0,20,QQQ_Events.size(),PC_Events.size()); plotter->Fill2D("PCEv_vs_QQQEv",20,0,20,20,0,20,QQQ_Events.size(),PC_Events.size());
@ -682,10 +736,13 @@ Bool_t MakeVertex::Process(Long64_t entry)
plotter->Fill1D("dt_pcA_sx3B",640,-2000,2000,sx3event.Time1 - pcevent.Time1); plotter->Fill1D("dt_pcA_sx3B",640,-2000,2000,sx3event.Time1 - pcevent.Time1);
plotter->Fill1D("dt_pcC_sx3B",640,-2000,2000,sx3event.Time1 - pcevent.Time2); plotter->Fill1D("dt_pcC_sx3B",640,-2000,2000,sx3event.Time1 - pcevent.Time2);
plotter->Fill2D("dt_pcA_qqqR_vs_qqqRE",640,-2000,2000,400,0,10,sx3event.Time1-pcevent.Time1, sx3event.Energy1*0.001);
plotter->Fill2D("dE_E_Anodesx3B",400,0,10,800,0,40000,sx3event.Energy1*0.001,pcevent.Energy1); plotter->Fill2D("dE_E_Anodesx3B",400,0,10,800,0,40000,sx3event.Energy1*0.001,pcevent.Energy1);
plotter->Fill2D("dE_E_Cathodesx3B",400,0,10,800,0,10000,sx3event.Energy1*0.001,pcevent.Energy2); plotter->Fill2D("dE_E_Cathodesx3B",400,0,10,800,0,10000,sx3event.Energy1*0.001,pcevent.Energy2);
plotter->Fill2D("sx3phi_vs_pcphi"+std::to_string(sx3event.Time1 - pcevent.Time1<-150),100,-360,360,100,-360,360,sx3event.pos.Phi()*180/M_PI,pcevent.pos.Phi()*180/M_PI); plotter->Fill2D("sx3phi_vs_pcphi"+std::to_string(sx3event.Time1 - pcevent.Time1<-150),100,-360,360,100,-360,360,sx3event.pos.Phi()*180/M_PI,pcevent.pos.Phi()*180/M_PI);
if(PCSX3TimeCut) { if(PCSX3TimeCut) {
plotter->Fill1D("dt_pcA_sx3B_timecut",640,-2000,2000,sx3event.Time1 - pcevent.Time1);
plotter->Fill1D("dt_pcC_sx3B_timecut",640,-2000,2000,sx3event.Time1 - pcevent.Time2);
plotter->Fill2D("xyplot_sx3"+std::to_string(sx3event.ch2/4),100,-100,100,100,-100,100,sx3event.pos.X(),sx3event.pos.Y()); plotter->Fill2D("xyplot_sx3"+std::to_string(sx3event.ch2/4),100,-100,100,100,-100,100,sx3event.pos.X(),sx3event.pos.Y());
plotter->Fill2D("xyplot_sx3"+std::to_string(sx3event.ch2/4),100,-100,100,100,-100,100,pcevent.pos.X(),pcevent.pos.Y()); plotter->Fill2D("xyplot_sx3"+std::to_string(sx3event.ch2/4),100,-100,100,100,-100,100,pcevent.pos.X(),pcevent.pos.Y());
plotter->Fill2D("pcz_vs_pcphi_TimeCut",600,-200,200,120,-360,360,pcevent.pos.Z(),pcevent.pos.Phi()*180/M_PI); //x-axis is all Si det, y-axis is PC anode+cathode only plotter->Fill2D("pcz_vs_pcphi_TimeCut",600,-200,200,120,-360,360,pcevent.pos.Z(),pcevent.pos.Phi()*180/M_PI); //x-axis is all Si det, y-axis is PC anode+cathode only
@ -713,28 +770,49 @@ Bool_t MakeVertex::Process(Long64_t entry)
plotter->Fill2D("pcz_vs_sx3pczguess",300,0,200,600,-200,200,pczguess,pcevent.pos.Z()); //x-axis is all Si det, y-axis is PC anode+cathode only plotter->Fill2D("pcz_vs_sx3pczguess",300,0,200,600,-200,200,pczguess,pcevent.pos.Z()); //x-axis is all Si det, y-axis is PC anode+cathode only
plotter->Fill2D("pcz_vs_sx3pczguess_int",300,0,200,600,-200,200,pcz_guess_int,pcevent.pos.Z()); //x-axis is all Si det, y-axis is PC anode+cathode only plotter->Fill2D("pcz_vs_sx3pczguess_int",300,0,200,600,-200,200,pcz_guess_int,pcevent.pos.Z()); //x-axis is all Si det, y-axis is PC anode+cathode only
//plotter->Fill2D("pcz_vs_sx3pczguess_strip"+std::to_string(sx3event.ch2),300,0,200,600,-200,200,pczguess,pcevent.pos.Z()); //plotter->Fill2D("pcz_vs_sx3pczguess_strip"+std::to_string(sx3event.ch2),300,0,200,600,-200,200,pczguess,pcevent.pos.Z());
plotter->Fill2D("pcz_vs_sx3pczguess_phi"+std::to_string(sx3event.pos.Phi()*180/M_PI),300,0,200,600,-200,200,pczguess,pcevent.pos.Z()); //plotter->Fill2D("pcz_vs_sx3pczguess_phi"+std::to_string(sx3event.pos.Phi()*180/M_PI),300,0,200,600,-200,200,pczguess,pcevent.pos.Z());
/*for(auto cc: cClusters) plotter->Fill2D("pcz_vs_sx3z_strip="+std::to_string(sx3event.ch2),300,0,100,600,-200,200,sx3z,pcevent.pos.Z(),"sx3_vs_pc_zcorr");
plotter->Fill2D("pcz_vs_sx3z_strip="+std::to_string(sx3event.ch2)+"_a"+std::to_string(pcevent.multi1)+"_c"+std::to_string(pcevent.multi2),300,0,100,600,-200,200,sx3z,pcevent.pos.Z(),"sx3_vs_pc_zcorr");
plotter->Fill2D("pcdEC_vs_sx3z_strip="+std::to_string(sx3event.ch2)+"_a"+std::to_string(pcevent.multi1)+"_c"+std::to_string(pcevent.multi2),800,0,20000,600,-200,200,pcevent.Energy2,sx3z,"sx3_vs_pc_zcorr");
plotter->Fill2D("pcdEA_vs_sx3z_strip="+std::to_string(sx3event.ch2)+"_a"+std::to_string(pcevent.multi1)+"_c"+std::to_string(pcevent.multi2),800,0,20000,600,-200,200,pcevent.Energy1,sx3z,"sx3_vs_pc_zcorr");
for(auto cc: cClusters)
for(auto ac: aClusters) { for(auto ac: aClusters) {
plotter->Fill2D("pcz_sx3_phicut_a"+std::to_string(ac.size())+"_c"+std::to_string(cc.size())+"_sx3guess",300,0,200,600,-200,200,sx3z,pcevent.pos.Z(),"hPCZSX3"); plotter->Fill2D("pcz_sx3_phicut_a"+std::to_string(ac.size())+"_c"+std::to_string(cc.size())+"_sx3guess",300,0,200,600,-200,200,sx3z,pcevent.pos.Z(),"hPCZSX3");
if(ac.size()==2 && cc.size()==1) { if(ac.size()==2 && cc.size()==1) {
plotter->Fill2D("pcz_sx3_phicut_a("+std::to_string(std::get<0>(ac.at(0)))+","+std::to_string(std::get<0>(ac.at(1)))+")_c"+std::to_string(std::get<0>(cc.at(0)))+"_sx3guess",300,0,200,600,-200,200,sx3z,pcevent.pos.Z(),"hPCZSX3"); plotter->Fill2D("pcz_sx3_phicut_a("+std::to_string(std::get<0>(ac.at(0)))+","+std::to_string(std::get<0>(ac.at(1)))+")_c"+std::to_string(std::get<0>(cc.at(0)))+"_sx3guess",300,0,200,600,-200,200,sx3z,pcevent.pos.Z(),"hPCZSX3");
plotter->Fill2D("a2c1_vs_sx3_strip",24,0,24,64,0,64,0.5*(std::get<0>(ac.at(0))+std::get<0>(ac.at(1))),sx3event.ch2,"hPCZSX3"); plotter->Fill2D("a2c1_vs_sx3_strip",24,0,24,64,0,64,0.5*(std::get<0>(ac.at(0))+std::get<0>(ac.at(1))),sx3event.ch2,"hPCZSX3");
plotter->Fill2D("sx3phi_vs_pcphi"+std::to_string(sx3event.Time1 - pcevent.Time1<-150)+"_a("+std::to_string(std::get<0>(ac.at(0)))+","+std::to_string(std::get<0>(ac.at(1)))+")_c"+std::to_string(std::get<0>(cc.at(0))),100,-360,360,100,-360,360,sx3event.pos.Phi()*180/M_PI,pcevent.pos.Phi()*180/M_PI); //plotter->Fill2D("sx3phi_vs_pcphi"+std::to_string(sx3event.Time1 - pcevent.Time1<-150)+"_a("+std::to_string(std::get<0>(ac.at(0)))+","+std::to_string(std::get<0>(ac.at(1)))+")_c"+std::to_string(std::get<0>(cc.at(0))),100,-360,360,100,-360,360,sx3event.pos.Phi()*180/M_PI,pcevent.pos.Phi()*180/M_PI);
} }
if(cc.size()==2 && ac.size()==1) { if(cc.size()==2 && ac.size()==1) {
plotter->Fill2D("pcz_sx3_phicut_c("+std::to_string(std::get<0>(cc.at(0)))+","+std::to_string(std::get<0>(cc.at(1)))+")_a"+std::to_string(std::get<0>(ac.at(0)))+"_sx3guess",300,0,200,600,-200,200,sx3z,pcevent.pos.Z(),"hPCZSX3"); plotter->Fill2D("pcz_sx3_phicut_c("+std::to_string(std::get<0>(cc.at(0)))+","+std::to_string(std::get<0>(cc.at(1)))+")_a"+std::to_string(std::get<0>(ac.at(0)))+"_sx3guess",300,0,200,600,-200,200,sx3z,pcevent.pos.Z(),"hPCZSX3");
plotter->Fill2D("c2a1_vs_sx3_strip",24,0,24,64,0,64,0.5*(std::get<0>(cc.at(0))+std::get<0>(cc.at(1))),sx3event.ch2,"hPCZSX3"); plotter->Fill2D("c2a1_vs_sx3_strip",24,0,24,64,0,64,0.5*(std::get<0>(cc.at(0))+std::get<0>(cc.at(1))),sx3event.ch2,"hPCZSX3");
plotter->Fill2D("sx3phi_vs_pcphi"+std::to_string(sx3event.Time1 - pcevent.Time1<-150)+"_c("+std::to_string(std::get<0>(cc.at(0)))+","+std::to_string(std::get<0>(cc.at(1)))+")_a"+std::to_string(std::get<0>(ac.at(0))),100,-360,360,100,-360,360,sx3event.pos.Phi()*180/M_PI,pcevent.pos.Phi()*180/M_PI); plotter->Fill2D("sx3phi_vs_pcphi"+std::to_string(sx3event.Time1 - pcevent.Time1<-150)+"_c("+std::to_string(std::get<0>(cc.at(0)))+","+std::to_string(std::get<0>(cc.at(1)))+")_a"+std::to_string(std::get<0>(ac.at(0))),100,-360,360,100,-360,360,sx3event.pos.Phi()*180/M_PI,pcevent.pos.Phi()*180/M_PI);
plotter->Fill2D("pcz_vs_sx3z_2C1A_phiCut_TC"+std::to_string(PCSX3TimeCut),300,0,200,600,-400,400,sx3z,pcevent.pos.Z());
} }
}*/
if(ac.size()==1 && cc.size()==1) {
plotter->Fill2D("pcz_sx3_phicut_a("+std::to_string(std::get<0>(ac.at(0)))+")_c"+std::to_string(std::get<0>(cc.at(0)))+"_sx3guess",300,0,200,600,-200,200,sx3z,pcevent.pos.Z(),"hPCZSX3");
//plotter->Fill2D("a2c1_vs_sx3_strip",24,0,24,64,0,64,0.5*(std::get<0>(ac.at(0))+std::get<0>(ac.at(1))),sx3event.ch2,"hPCZSX3");
//plotter->Fill2D("sx3phi_vs_pcphi"+std::to_string(sx3event.Time1 - pcevent.Time1<-150)+"_a("+std::to_string(std::get<0>(ac.at(0)))+")_c"+std::to_string(std::get<0>(cc.at(0))),100,-360,360,100,-360,360,sx3event.pos.Phi()*180/M_PI,pcevent.pos.Phi()*180/M_PI);
}
}
bool sx3PhiCut = (TMath::Abs(sx3event.pos.Phi()-pcevent.pos.Phi()) < 45.0*M_PI/180.);
plotter->Fill1D("pcz_sx3Coinc_phiCut"+std::to_string(sx3PhiCut)+"_TC"+std::to_string(PCSX3TimeCut),300,0,200,sx3z);
plotter->Fill2D("pcz_vs_sx3z_phiCut"+std::to_string(sx3PhiCut)+"_TC"+std::to_string(PCSX3TimeCut),300,0,200,600,-400,400,sx3z,pcevent.pos.Z());
plotter->Fill2D("pcz_vs_sx3z",300,0,200,600,-400,400,sx3z,pcevent.pos.Z());
plotter->Fill2D("sx3E_vs_sx3z"+std::to_string(sx3event.ch2),400,0,10,300,0,200,sx3event.Energy1*0.001,sx3z); plotter->Fill2D("sx3E_vs_sx3z"+std::to_string(sx3event.ch2),400,0,10,300,0,200,sx3event.Energy1*0.001,sx3z);
plotter->Fill2D("pcdEA_vs_sx3z",800,0,20000,300,0,200,pcevent.Energy1,sx3z); plotter->Fill2D("pcdEA_vs_sx3z",800,0,20000,300,0,200,pcevent.Energy1,sx3z);
plotter->Fill2D("pcdE2A_vs_sx3z",800,0,20000,300,0,200,pcevent.Energy1*sinTheta,sx3z);
plotter->Fill2D("pcdEC_vs_sx3z",800,0,20000,300,0,200,pcevent.Energy2,sx3z); plotter->Fill2D("pcdEC_vs_sx3z",800,0,20000,300,0,200,pcevent.Energy2,sx3z);
plotter->Fill2D("pcdEA_vs_sx3z"+std::to_string(sx3event.ch2),800,0,20000,300,0,200,pcevent.Energy1,sx3z,"pcE_vs_sx3pos");
plotter->Fill2D("pcdEC_vs_sx3z"+std::to_string(sx3event.ch2),800,0,20000,300,0,200,pcevent.Energy2,sx3z,"pcE_vs_sx3pos");
plotter->Fill2D("pcdE2A_vs_sx3z",800,0,20000,300,0,200,pcevent.Energy1*sinTheta,sx3z);
plotter->Fill2D("pcdE2C_vs_sx3z",800,0,20000,300,0,200,pcevent.Energy2*sinTheta,sx3z); plotter->Fill2D("pcdE2C_vs_sx3z",800,0,20000,300,0,200,pcevent.Energy2*sinTheta,sx3z);
plotter->Fill2D("phi_vs_stripnum",180,-180,180,48,0,48,pcevent.pos.Phi()*180./M_PI,sx3event.ch2); plotter->Fill2D("phi_vs_stripnum",180,-180,180,48,0,48,pcevent.pos.Phi()*180./M_PI,sx3event.ch2);
plotter->Fill2D("E_theta_AnodeSX3",200,80,180,300,0,15,sx3theta*180/M_PI,sx3event.Energy1*0.001); plotter->Fill2D("E_theta_AnodeSX3",200,80,180,300,0,15,sx3theta*180/M_PI,sx3event.Energy1*0.001);
@ -742,16 +820,17 @@ Bool_t MakeVertex::Process(Long64_t entry)
if(PCSX3TimeCut) { if(PCSX3TimeCut) {
plotter->Fill1D("PCZ_sx3",800,-200,200,pcevent.pos.Z(),"hPCZSX3"); plotter->Fill1D("PCZ_sx3",800,-200,200,pcevent.pos.Z(),"hPCZSX3");
plotter->Fill1D("PCZ",800,-200,200,pcevent.pos.Z(),"phicut"); plotter->Fill1D("PCZ",800,-200,200,pcevent.pos.Z(),"phicut");
for(auto cc: cClusters) /*for(auto cc: cClusters)
for(auto ac: aClusters) { for(auto ac: aClusters) {
plotter->Fill1D("PCZsx3_phicut_a"+std::to_string(ac.size())+"_c"+std::to_string(cc.size()),800,-200,200,pcevent.pos.Z(),"hPCZSX3"); plotter->Fill1D("PCZsx3_phicut_a"+std::to_string(ac.size())+"_c"+std::to_string(cc.size()),800,-200,200,pcevent.pos.Z(),"hPCZSX3");
} }*/
} }
} }
for(auto pcevent: PC_Events) { for(auto pcevent: PC_Events) {
for(auto qqqevent: QQQ_Events) { for(auto qqqevent: QQQ_Events) {
plotter->Fill1D("dt_pcA_qqqR",640,-2000,2000,qqqevent.Time1 - pcevent.Time1); plotter->Fill1D("dt_pcA_qqqR",640,-2000,2000,qqqevent.Time1 - pcevent.Time1);
plotter->Fill2D("dt_pcA_qqqR_vs_qqqRE",640,-2000,2000,400,0,10,qqqevent.Time1-pcevent.Time1, qqqevent.Energy1);
plotter->Fill1D("dt_pcC_qqqW",640,-2000,2000,qqqevent.Time2 - pcevent.Time2); plotter->Fill1D("dt_pcC_qqqW",640,-2000,2000,qqqevent.Time2 - pcevent.Time2);
plotter->Fill2D("phiPC_vs_phiQQQ",180,-360,360,180,-360,360,qqqevent.pos.Phi()*180/M_PI,pcevent.pos.Phi()*180/M_PI); plotter->Fill2D("phiPC_vs_phiQQQ",180,-360,360,180,-360,360,qqqevent.pos.Phi()*180/M_PI,pcevent.pos.Phi()*180/M_PI);
double sinTheta = TMath::Sin((qqqevent.pos - TVector3(0,0,source_vertex)).Theta());///TMath::Sin((TVector3(51.5,0,128.) - TVector3(0,0,85)).Theta()); double sinTheta = TMath::Sin((qqqevent.pos - TVector3(0,0,source_vertex)).Theta());///TMath::Sin((TVector3(51.5,0,128.) - TVector3(0,0,85)).Theta());
@ -767,10 +846,14 @@ Bool_t MakeVertex::Process(Long64_t entry)
plotter->Fill2D("dE_E_CathodeQQQR_inner",400,0,10,800,0,10000,qqqevent.Energy2,pcevent.Energy2); plotter->Fill2D("dE_E_CathodeQQQR_inner",400,0,10,800,0,10000,qqqevent.Energy2,pcevent.Energy2);
} }
//bool timecut = (qqqevent.Time1 - pcevent.Time1 < -150);
bool timecut = (qqqevent.Time1 - pcevent.Time1 < -150); bool timecut = (qqqevent.Time1 - pcevent.Time1 < -150);
if(timecut) {// && qqqevent.pos.Phi() <= pcevent.pos.Phi()+TMath::Pi()/4. && qqqevent.pos.Phi() >= pcevent.pos.Phi()-TMath::Pi()/4. ) { if(timecut) {// && qqqevent.pos.Phi() <= pcevent.pos.Phi()+TMath::Pi()/4. && qqqevent.pos.Phi() >= pcevent.pos.Phi()-TMath::Pi()/4. ) {
plotter->Fill1D("dt_pcA_qqqR_timecut",640,-2000,2000,qqqevent.Time1 - pcevent.Time1);
plotter->Fill1D("dt_pcC_qqqW_timecut",640,-2000,2000,qqqevent.Time2 - pcevent.Time2);
plotter->Fill2D("dE_theta_AnodeQQQR",75,0,90,400,0,20000,(qqqevent.pos - TVector3(0,0,source_vertex)).Theta()*180/M_PI,pcevent.Energy1); plotter->Fill2D("dE_theta_AnodeQQQR",75,0,90,400,0,20000,(qqqevent.pos - TVector3(0,0,source_vertex)).Theta()*180/M_PI,pcevent.Energy1);
plotter->Fill2D("dE2_theta_AnodeQQQR",75,0,90,400,0,20000,(qqqevent.pos - TVector3(0,0,source_vertex)).Theta()*180/M_PI,pcevent.Energy1*sinTheta); plotter->Fill2D("dE2_theta_AnodeQQQR",75,0,90,400,0,20000,(qqqevent.pos - TVector3(0,0,source_vertex)).Theta()*180/M_PI,pcevent.Energy1*sinTheta);
plotter->Fill2D("phiPC_vs_phiQQQ_TimeCut",180,-360,360,180,-360,360,qqqevent.pos.Phi()*180/M_PI,pcevent.pos.Phi()*180/M_PI);
plotter->Fill2D("E_theta_AnodeQQQR",75,0,90,300,0,15,(qqqevent.pos - TVector3(0,0,source_vertex)).Theta()*180/M_PI,qqqevent.Energy1); plotter->Fill2D("E_theta_AnodeQQQR",75,0,90,300,0,15,(qqqevent.pos - TVector3(0,0,source_vertex)).Theta()*180/M_PI,qqqevent.Energy1);
plotter->Fill2D("E2_theta_AnodeQQQR",75,0,90,300,0,15,(qqqevent.pos - TVector3(0,0,source_vertex)).Theta()*180/M_PI,qqqevent.Energy1); plotter->Fill2D("E2_theta_AnodeQQQR",75,0,90,300,0,15,(qqqevent.pos - TVector3(0,0,source_vertex)).Theta()*180/M_PI,qqqevent.Energy1);
@ -813,7 +896,7 @@ Bool_t MakeVertex::Process(Long64_t entry)
} }
} }
//HALFTIME! Can stop here in future versions //HALFTIME! Can stop here in future versions
return kTRUE;
if (anodeHits.size() >= 1 && cathodeHits.size() >= 1) if (anodeHits.size() >= 1 && cathodeHits.size() >= 1)
{ {
// 2. CRITICAL FIX: Define reference vector 'a' // 2. CRITICAL FIX: Define reference vector 'a'
@ -1214,10 +1297,10 @@ Bool_t MakeVertex::Process(Long64_t entry)
void MakeVertex::Terminate() void MakeVertex::Terminate()
{ {
plotter->FlushToDisk(); plotter->FlushToDisk();
can1->Modified(); /* can1->Modified();
can1->Update(); can1->Update();
can2->Modified(); can2->Modified();
can2->Update(); can2->Update();
while(can1->WaitPrimitive()); while(can1->WaitPrimitive());
while(can2->WaitPrimitive()); while(can2->WaitPrimitive());*/
} }

View File

@ -1,35 +1,76 @@
#Alpha runs at different spacer positions #Alpha runs at different spacer positions
#rm results_run*.root #rm results_run*.root
#root -q -l -x ../ANASEN_analysis/data/27Al_Data/Run_009_mapped.root -e 'tree->Process("MakeVertex.C+")'; mv Analyzer_SX3.root results_run09.root; #root -q -l -x ../ANASEN_analysis/data/27Al_Data/Run_009_mapped.root -e 'tree->Process("MakeVertex.C+O")'; mv Analyzer_SX3.root results_run09.root;
#root -q -l -x ../ANASEN_analysis/data/27Al_Data/Run_001_mapped.root -e 'tree->Process("MakeVertex.C+")'; mv Analyzer_SX3.root results_run01.root; #root -q -l -x ../ANASEN_analysis/data/27Al_Data/Run_001_mapped.root -e 'tree->Process("MakeVertex.C+O")'; mv Analyzer_SX3.root results_run01.root;
#root -q -l -x ../ANASEN_analysis/data/27Al_Data/Run_002_mapped.root -e 'tree->Process("MakeVertex.C+")'; mv Analyzer_SX3.root results_run02.root; #root -q -l -x ../ANASEN_analysis/data/27Al_Data/Run_002_mapped.root -e 'tree->Process("MakeVertex.C+O")'; mv Analyzer_SX3.root results_run02.root;
#root -q -l -x ../ANASEN_analysis/data/27Al_Data/Run_003_mapped.root -e 'tree->Process("MakeVertex.C+")'; mv Analyzer_SX3.root results_run03.root; #root -q -l -x ../ANASEN_analysis/data/27Al_Data/Run_003_mapped.root -e 'tree->Process("MakeVertex.C+O")'; mv Analyzer_SX3.root results_run03.root;
#root -q -l -x ../ANASEN_analysis/data/27Al_Data/Run_004_mapped.root -e 'tree->Process("MakeVertex.C+")'; mv Analyzer_SX3.root results_run04.root; #root -q -l -x ../ANASEN_analysis/data/27Al_Data/Run_004_mapped.root -e 'tree->Process("MakeVertex.C+O")'; mv Analyzer_SX3.root results_run04.root;
#alpha+gas 27Al #alpha+gas 27Al
root -q -b -x ../ANASEN_analysis/data/27Al_Data/Run_009_mapped.root -e 'tree->Process("MakeVertex.C+O")'; mv Analyzer_SX3.root results_run09.root; export DATASET="26Al"
root -q -b -x ../ANASEN_analysis/data/27Al_Data/Run_012_mapped.root -e 'tree->Process("MakeVertex.C+O")'; mv Analyzer_SX3.root results_run12.root; export flip180="0"
#root -q -b -x ../ANASEN_analysis/data/27Al_Data/Run_009_mapped.root -e 'tree->Process("MakeVertex.C+O")'; mv Analyzer_SX3.root results_run09.root;
#root -q -b -x ../ANASEN_analysis/data/27Al_Data/Run_012_mapped.root -e 'tree->Process("MakeVertex.C+O")'; mv Analyzer_SX3.root results_run12.root;
#root -q -b -x ../ANASEN_analysis/data/27Al_Data/Run_013_mapped.root -e 'tree->Process("MakeVertex.C+O")'; mv Analyzer_SX3.root results_run13.root;
#exit
#protons+gas, 27Al #protons+gas, 27Al
root -q -b -x ../ANASEN_analysis/data/27Al_Data/Run_022_mapped.root -e 'tree->Process("MakeVertex.C+")'; mv Analyzer_SX3.root results_run22.root; export flip180="1"
#root -q -b -x ../ANASEN_analysis/data/27Al_Data/Run_021_mapped.root -e 'tree->Process("MakeVertex.C+")'; mv Analyzer_SX3.root results_run21.root; #root -q -b -x ../ANASEN_analysis/data/27Al_Data/Run_015_mapped.root -e 'tree->Process("MakeVertex.C+O")'; mv Analyzer_SX3.root results_run15.root;
#root -q -b -x ../ANASEN_analysis/data/27Al_Data/Run_017_mapped.root -e 'tree->Process("MakeVertex.C+O")'; mv Analyzer_SX3.root results_run17.root;
#root -q -b -x ../ANASEN_analysis/data/27Al_Data/Run_018_mapped.root -e 'tree->Process("MakeVertex.C+O")'; mv Analyzer_SX3.root results_run18.root;
#root -q -b -x ../ANASEN_analysis/data/27Al_Data/Run_019_mapped.root -e 'tree->Process("MakeVertex.C+O")'; mv Analyzer_SX3.root results_run19.root;
#root -q -b -x ../ANASEN_analysis/data/27Al_Data/Run_020_mapped.root -e 'tree->Process("MakeVertex.C+O")'; mv Analyzer_SX3.root results_run20.root;
#root -q -b -x ../ANASEN_analysis/data/27Al_Data/Run_021_mapped.root -e 'tree->Process("MakeVertex.C+O")'; mv Analyzer_SX3.root results_run21.root;
#root -q -b -x ../ANASEN_analysis/data/27Al_Data/Run_022_mapped.root -e 'tree->Process("MakeVertex.C+O")'; mv Analyzer_SX3.root results_run22.root;
#exit
#27Al reaction data #27Al reaction data
#root -b -q -l -x ../ANASEN_analysis/data/27Al_Data/Run_051_mapped.root -e 'tree->Process("MakeVertex.C+")'; mv Analyzer_SX3.root results_run51.root; #root -b -q -l -x ../ANASEN_analysis/data/27Al_Data/Run_051_mapped.root -e 'tree->Process("MakeVertex.C+O")'; mv Analyzer_SX3.root results_run51.root;
#root -b -q -l -x ../ANASEN_analysis/data/27Al_Data/Run_078_mapped.root -e 'tree->Process("MakeVertex.C+")'; mv Analyzer_SX3.root results_run78.root; #root -b -q -l -x ../ANASEN_analysis/data/27Al_Data/Run_078_mapped.root -e 'tree->Process("MakeVertex.C+O")'; mv Analyzer_SX3.root results_run78.root;
#root -b -q -l -x ../ANASEN_analysis/data/27Al_Data/Run_081_mapped.root -e 'tree->Process("MakeVertex.C+")'; mv Analyzer_SX3.root results_run81.root; #root -b -q -l -x ../ANASEN_analysis/data/27Al_Data/Run_081_mapped.root -e 'tree->Process("MakeVertex.C+O")'; mv Analyzer_SX3.root results_run81.root;
#root -l -x results_run19.root results_run12.root -e "new TBrowser" #root -l -x results_run19.root results_run12.root -e "new TBrowser"
#exit
export DATASET="17F"
export flip180="0"
#root -q -l -b -x ../ANASEN_analysis/data/17F_Data/Source_005_mapped.root -e 'tree->Process("MakeVertex.C+O")'; mv Analyzer_SX3.root results_run05.root;
#root -q -l -b -x ../ANASEN_analysis/data/17F_Data/Source_006_mapped.root -e 'tree->Process("MakeVertex.C+O")'; mv Analyzer_SX3.root results_run06.root;
#root -q -l -b -x ../ANASEN_analysis/data/17F_Data/Source_007_mapped.root -e 'tree->Process("MakeVertex.C+O")'; mv Analyzer_SX3.root results_run07.root;
#root -q -l -b -x ../ANASEN_analysis/data/17F_Data/Source_008_mapped.root -e 'tree->Process("MakeVertex.C+O")'; mv Analyzer_SX3.root results_run08.root;
#root -q -l -b -x ../ANASEN_analysis/data/17F_Data/Source_009_mapped.root -e 'tree->Process("MakeVertex.C+O")'; mv Analyzer_SX3.root results_run09.root;
#root -q -l -b -x ../ANASEN_analysis/data/17F_Data/Source_010_mapped.root -e 'tree->Process("MakeVertex.C+O")'; mv Analyzer_SX3.root results_run10.root;
#root -q -l -b -x ../ANASEN_analysis/data/17F_Data/Source_011_mapped.root -e 'tree->Process("MakeVertex.C+O")'; mv Analyzer_SX3.root results_run11.root;
#root -q -l -b -x ../ANASEN_analysis/data/17F_Data/Source_012_mapped.root -e 'tree->Process("MakeVertex.C+O")'; mv Analyzer_SX3.root results_run12.root;
#root -q -l -b -x ../ANASEN_analysis/data/17F_Data/Source_013_mapped.root -e 'tree->Process("MakeVertex.C+O")'; mv Analyzer_SX3.root results_run13.root;
#root -q -l -b -x ../ANASEN_analysis/data/17F_Data/Source_014_mapped.root -e 'tree->Process("MakeVertex.C+O")'; mv Analyzer_SX3.root results_run14.root;
#17F pulser runs #17F pulser runs
#root -q -l -b -x ../ANASEN_analysis/data/17F_Data/PulserRun_015_mapped.root -e 'tree->Process("MakeVertex.C+")'; mv Analyzer_SX3.root results_run15.root; #root -q -l -b -x ../ANASEN_analysis/data/17F_Data/PulserRun_015_mapped.root -e 'tree->Process("MakeVertex.C+O")'; mv Analyzer_SX3.root results_run15.root;
#root -q -l -b -x ../ANASEN_analysis/data/17F_Data/PulserRun_016_mapped.root -e 'tree->Process("MakeVertex.C+")'; mv Analyzer_SX3.root results_run16.root; #root -q -l -b -x ../ANASEN_analysis/data/17F_Data/PulserRun_016_mapped.root -e 'tree->Process("MakeVertex.C+O")'; mv Analyzer_SX3.root results_run16.root;
#root -q -l -b -x ../ANASEN_analysis/data/17F_Data/PulserRun_017_mapped.root -e 'tree->Process("MakeVertex.C+")'; mv Analyzer_SX3.root results_run17.root; #root -q -l -b -x ../ANASEN_analysis/data/17F_Data/PulserRun_017_mapped.root -e 'tree->Process("MakeVertex.C+O")'; mv Analyzer_SX3.root results_run17.root;
#17F alpha run with gas #17F alpha run with gas
root -q -l -b -x ../ANASEN_analysis/data/17F_Data/SourceRun_018_mapped.root -e 'tree->Process("MakeVertex.C+")'; mv Analyzer_SX3.root results_run18.root; #root -q -l -b -x ../ANASEN_analysis/data/17F_Data/SourceRun_018_mapped.root -e 'tree->Process("MakeVertex.C+O")'; mv Analyzer_SX3.root results_run18.root;
root -q -l -b -x ../ANASEN_analysis/data/17F_Data/SourceRun_019_mapped.root -e 'tree->Process("MakeVertex.C+")'; mv Analyzer_SX3.root results_run19.root; #root -q -l -b -x ../ANASEN_analysis/data/17F_Data/SourceRun_019_mapped.root -e 'tree->Process("MakeVertex.C+O")'; mv Analyzer_SX3.root results_run19.root;
root -q -l -b -x ../ANASEN_analysis/data/17F_Data/SourceRun_020_mapped.root -e 'tree->Process("MakeVertex.C+")'; mv Analyzer_SX3.root results_run20.root; #root -q -l -b -x ../ANASEN_analysis/data/17F_Data/SourceRun_020_mapped.root -e 'tree->Process("MakeVertex.C+O")'; mv Analyzer_SX3.root results_run20.root;
root -q -l -b -x ../ANASEN_analysis/data/17F_Data/SourceRun_021_mapped.root -e 'tree->Process("MakeVertex.C+")'; mv Analyzer_SX3.root results_run21.root; #root -q -l -b -x ../ANASEN_analysis/data/17F_Data/SourceRun_021_mapped.root -e 'tree->Process("MakeVertex.C+O")'; mv Analyzer_SX3.root results_run21.root;
#root -q -l -b -x ../ANASEN_analysis/data/17F_Data/Run_104_mapped.root -e 'tree->Process("MakeVertex.C+")'; mv Analyzer_SX3.root results_run104.root;
#17F reaction data
export flip180="1"
#export source_vertex=-57.28; root -q -l -b -x ../ANASEN_analysis/data/17F_Data/ProtonRun_035_mapped.root -e 'tree->Process("MakeVertex.C+O")'; mv Analyzer_SX3.root results_run35.root;
export source_vertex=-8.28; root -q -l -b -x ../ANASEN_analysis/data/17F_Data/ProtonRun_036_mapped.root -e 'tree->Process("MakeVertex.C+O")'; mv Analyzer_SX3.root resulrs_run36.root;
export source_vertex=-27.88; root -q -l -b -x ../ANASEN_analysis/data/17F_Data/ProtonRun_037_mapped.root -e 'tree->Process("MakeVertex.C+O")'; mv Analyzer_SX3.root results_run37.root;
export source_vertex=11.32; root -q -l -b -x ../ANASEN_analysis/data/17F_Data/ProtonRun_038_mapped.root -e 'tree->Process("MakeVertex.C+O")'; mv Analyzer_SX3.root results_run38.root;
export source_vertex=30.92; root -q -l -b -x ../ANASEN_analysis/data/17F_Data/ProtonRun_039_mapped.root -e 'tree->Process("MakeVertex.C+O")'; mv Analyzer_SX3.root results_run39.root;
export source_vertex=50.52; root -q -l -b -x ../ANASEN_analysis/data/17F_Data/ProtonRun_041_mapped.root -e 'tree->Process("MakeVertex.C+O")'; mv Analyzer_SX3.root results_run41.root;
export source_vertex=70.12; root -q -l -b -x ../ANASEN_analysis/data/17F_Data/ProtonRun_042_mapped.root -e 'tree->Process("MakeVertex.C+O")'; mv Analyzer_SX3.root results_run42.root;
export source_vertex=109.32; root -q -l -b -x ../ANASEN_analysis/data/17F_Data/ProtonRun_043_mapped.root -e 'tree->Process("MakeVertex.C+O")'; mv Analyzer_SX3.root results_run43.root;
#root -q -l -b -x ../ANASEN_analysis/data/17F_Data/ProtonRun_043_mapped.root -e 'tree->Process("MakeVertex.C+O")'; mv Analyzer_SX3.root results_run43.root;
#root -q -l -b -x ../ANASEN_analysis/data/17F_Data/Run_099_mapped.root -e 'tree->Process("MakeVertex.C+O")'; mv Analyzer_SX3.root results_run99.root;
#root -q -l -b -x ../ANASEN_analysis/data/17F_Data/Run_104_mapped.root -e 'tree->Process("MakeVertex.C+O")'; mv Analyzer_SX3.root results_run104.root;
#mv Analyzer_SX3.root results_run19.root; #mv Analyzer_SX3.root results_run19.root;
unset souce_vertex
unset DATASET
unset flip180

0
scratch/flip_anode.h Normal file
View File

1
scratch/flip_cathode.h Normal file
View File

@ -0,0 +1 @@

View File

@ -0,0 +1,38 @@
int quit=0;
void handler(int){quit=1;}
void scan_offset(){
signal(SIGINT,handler);
TCanvas c("c1","c1",0,0,1600,800);
c.Divide(2,1);
for(int i=0; i<=23; i++) {
auto c1=c.cd(1);
c1->SetGrid(1,1);
TFile *f = new TFile(Form("results_run12_anodeoffset%d.root",i));
//TH2F *h2 = (TH2F*)(f->Get("phicut/pczguess_vs_pc_int"));
TH2F *h2 = (TH2F*)(f->Get("pcz_vs_sx3z"));
// TH2F *h2 = (TH2F*)(f->Get("hPCQQQ/PC_XY_Projection_QQQ2"));
if(!h2) continue;
h2->SetTitle(Form("case%d",i));
h2->Draw("colz");
c1->Modified();
c1->Update();
auto c2=c.cd(2);
c2->SetGrid(1,1);
TH2F *h3 = (TH2F*)(f->Get("sx3phi_vs_pcphi1"));
// TH2F *h2 = (TH2F*)(f->Get("hPCQQQ/PC_XY_Projection_QQQ2"));
if(!h3) continue;
h3->SetTitle(Form("case%d",i));
h3->Draw("colz");
c2->Modified();
c2->Update();
while(gPad->WaitPrimitive());
f->Close();
if(i==23) i=0;
if(quit) break;
}
}

11
scratch/flipscan_anode.sh Normal file
View File

@ -0,0 +1,11 @@
declare -i i=0
while [[ $i -lt 24 ]]; do
cd ..
export flipa=$i
bash run_sx3.sh
cp results_run12.root results_run12_noflip_anodeoffset$i.root
#cp results_run21.root results_run21_anodeoffset$i.root
cd -
i=i+1
done
unset flipa

View File

@ -0,0 +1,11 @@
declare -i i=0
while [[ $i -lt 24 ]]; do
cd ..
export flipc=$i
bash run_sx3.sh
cp results_run12.root results_run12_noflip_cathodeoffset$i.root
#cp results_run21.root results_run21_noflip_cathodeoffset$i.root
cd -
i=i+1
done
unset flipc

View File

@ -0,0 +1,22 @@
int quit=0;
void handler(int){quit=1;}
void scan_offset(){
signal(SIGINT,handler);
for(int i=0; i<=23; i++) {
TFile *f = new TFile(Form("results_run12_noflip_anodeoffset%d.root",i));
//TH2F *h2 = (TH2F*)(f->Get("phicut/pczguess_vs_pc_int"));
TH2F *h2 = (TH2F*)(f->Get("pcz_vs_sx3z"));
// TH2F *h2 = (TH2F*)(f->Get("hPCQQQ/PC_XY_Projection_QQQ2"));
if(!h2) continue;
h2->SetTitle(Form("case%d",i));
h2->Draw("colz");
gPad->Modified();
gPad->Update();
while(gPad->WaitPrimitive());
f->Close();
if(i==23) i=0;
if(quit) break;
}
}

View File

@ -0,0 +1,40 @@
int quit=0;
void handler(int){quit=1;}
void scan_offset(){
signal(SIGINT,handler);
TCanvas c("c1","c1",0,0,1600,800);
c.Divide(2,1);
for(int i=36; i<=43; i++) {
auto c1=c.cd(1);
c1->SetGrid(1,1);
TFile *f = new TFile(Form("../../results_run%d.root",i));
//TH2F *h2 = (TH2F*)(f->Get("phicut/pczguess_vs_pc_int"));
TH2F *h2 = (TH2F*)(f->Get("pcz_vs_sx3z_phiCut1_TC1"));
// TH2F *h2 = (TH2F*)(f->Get("pcz_vs_sx3z_2C1A_phiCut_TC1"));
//TH1F *h2 = (TH1F*)(f->Get("pcz_sx3Coinc_phiCut1_TC1"));
// TH2F *h2 = (TH2F*)(f->Get("hPCQQQ/PC_XY_Projection_QQQ2"));
if(!h2) continue;
h2->SetTitle(Form("case%d",i));
h2->Draw("colz");
c1->Modified();
c1->Update();
auto c2=c.cd(2);
c2->SetGrid(1,1);
TH2F *h3 = (TH2F*)(f->Get("sx3phi_vs_pcphi1"));
// TH2F *h2 = (TH2F*)(f->Get("hPCQQQ/PC_XY_Projection_QQQ2"));
if(!h3) continue;
h3->SetTitle(Form("case%d",i));
h3->Draw("colz");
c2->Modified();
c2->Update();
while(gPad->WaitPrimitive());
f->Close();
if(i==43) i=35;
if(quit) break;
}
}

View File

@ -0,0 +1,38 @@
int quit=0;
void handler(int){quit=1;}
void scan_offset(){
signal(SIGINT,handler);
TCanvas c("c1","c1",0,0,1600,800);
c.Divide(1,1);
for(int i=0; i<=23; i++) {
auto c1=c.cd(1);
c1->SetGrid(1,1);
TFile *f = new TFile(Form("../../results_run21.root"));
//TH2F *h2 = (TH2F*)(f->Get("phicut/pczguess_vs_pc_int"));
TH2F *h2 = (TH2F*)(f->Get(std::string("sx3_z_phi2_awire"+std::to_string(i)).c_str()));
// TH2F *h2 = (TH2F*)(f->Get("hPCQQQ/PC_XY_Projection_QQQ2"));
if(!h2) continue;
h2->SetTitle(Form("anode_wire%d",i));
h2->Draw("colz");
c1->Modified();
c1->Update();
/* auto c2=c.cd(2);
c2->SetGrid(1,1);
TH2F *h3 = (TH2F*)(f->Get("sx3phi_vs_pcphi1"));
// TH2F *h2 = (TH2F*)(f->Get("hPCQQQ/PC_XY_Projection_QQQ2"));
if(!h3) continue;
h3->SetTitle(Form("case%d",i));
h3->Draw("colz");
c2->Modified();
c2->Update();*/
while(gPad->WaitPrimitive());
f->Close();
if(i==23) i=0;
if(quit) break;
}
}

View File

@ -0,0 +1,38 @@
int quit=0;
void handler(int){quit=1;}
void scan_offset_c(){
signal(SIGINT,handler);
TCanvas c("c1","c1",0,0,1600,800);
c.Divide(1,1);
for(int i=0; i<=23; i++) {
auto c1=c.cd(1);
c1->SetGrid(1,1);
TFile *f = new TFile(Form("../../results_run21.root"));
//TH2F *h2 = (TH2F*)(f->Get("phicut/pczguess_vs_pc_int"));
TH2F *h2 = (TH2F*)(f->Get(std::string("sx3_z_phi2_cwire"+std::to_string(i)).c_str()));
// TH2F *h2 = (TH2F*)(f->Get("hPCQQQ/PC_XY_Projection_QQQ2"));
if(!h2) continue;
h2->SetTitle(Form("cathode_wire%d",i));
h2->Draw("colz");
c1->Modified();
c1->Update();
/* auto c2=c.cd(2);
c2->SetGrid(1,1);
TH2F *h3 = (TH2F*)(f->Get("sx3phi_vs_pcphi1"));
// TH2F *h2 = (TH2F*)(f->Get("hPCQQQ/PC_XY_Projection_QQQ2"));
if(!h3) continue;
h3->SetTitle(Form("case%d",i));
h3->Draw("colz");
c2->Modified();
c2->Update();*/
while(gPad->WaitPrimitive());
f->Close();
if(i==23) i=0;
if(quit) break;
}
}

View File

@ -1,23 +1,26 @@
1 front 1 back 2 4.4094 1 front 0 back 2 4.1692
1 front 1 back 1 4.4094 1 front 1 back 2 4.13701
1 front 2 back 2 4.4832 1 front 2 back 2 4.26886
1 front 3 back 2 4.52103 1 front 3 back 2 4.26886
1 front 3 back 1 4.5210 3 front 1 back 2 3.31729
3 front 1 back 2 3.63215 3 front 1 back 1 3.33796
3 front 1 back 1 3.70756 3 front 2 back 2 3.35889
3 front 2 back 2 3.68208 3 front 2 back 1 3.49018
3 front 2 back 1 3.86817 3 front 3 back 2 3.38008
3 front 3 back 2 3.7334 3 front 3 back 1 3.35889
3 front 3 back 1 3.70756 7 front 0 back 2 3.25679
7 front 1 back 2 3.60769 7 front 0 back 1 3.08785
7 front 1 back 1 3.46759 7 front 1 back 2 3.25679
7 front 2 back 2 3.58356 7 front 1 back 1 3.14218
7 front 2 back 1 3.49018 7 front 2 back 2 3.29688
7 front 3 back 2 3.60769 7 front 2 back 1 3.16072
7 front 3 back 1 3.46759 7 front 3 back 2 3.29688
9 front 1 back 2 3.58356 7 front 3 back 1 3.12386
9 front 1 back 1 3.44529 9 front 0 back 2 3.25679
9 front 2 back 2 3.58356 9 front 0 back 1 3.10575
9 front 2 back 1 3.46759 9 front 1 back 2 3.27671
9 front 3 back 2 3.63215 9 front 1 back 1 3.12386
9 front 3 back 1 3.46759 9 front 2 back 2 3.29688
9 front 2 back 1 3.14218
9 front 3 back 2 3.29688
9 front 3 back 1 3.10575

View File

@ -1,12 +1,15 @@
1 lengthcal front 1 1.5121 60.4839 1 lengthcal front 0 0.302419 60.4839
1 lengthcal front 2 -1.5625 62.5 1 lengthcal front 1 0.907258 60.4839
1 lengthcal front 3 2.72177 60.4839 1 lengthcal front 2 -2.11694 60.4839
3 lengthcal front 1 -0.595088 59.5088 1 lengthcal front 3 3.32661 60.4839
3 lengthcal front 2 -4.53935 58.5723 3 lengthcal front 1 -0.302419 60.4839
3 lengthcal front 3 4.08107 60.4603 3 lengthcal front 2 -3.12146 59.4564
7 lengthcal front 1 1.14329 45.7317 3 lengthcal front 3 5.3066 62.4306
7 lengthcal front 2 0.115661 46.2646 7 lengthcal front 0 0.225805 45.1611
7 lengthcal front 3 2.90179 44.6429 7 lengthcal front 1 1.85157 46.2892
9 lengthcal front 1 0.115732 46.2928 7 lengthcal front 2 0.936622 46.8311
9 lengthcal front 2 0.799176 45.6672 7 lengthcal front 3 3.65527 45.6909
9 lengthcal front 3 1.68159 48.0453 9 lengthcal front 0 2.10806 46.8457
9 lengthcal front 1 0.694127 46.2751
9 lengthcal front 2 1.04095 46.2646
9 lengthcal front 3 1.99048 46.8348

View File

@ -1,16 +1,16 @@
1 0 1678.38 1.0 1 0 1239.16 0.649287
1 1 1678.38 1.07163 1 1 1853.11 1.08968
1 2 1693.99 1.1035 1 2 1852.65 1.10279
1 3 1667.9 0.975015 1 3 1821.01 0.965101
3 0 1597.96 1.0 3 0 1749.6 1.
3 1 1597.96 1.02536 3 1 1749.6 1.01204
3 2 1821.48 1.29182 3 2 1954.81 1.23687
3 3 1607.52 0.928543 3 3 1751.15 0.904329
7 0 1773.34 1. 9 0 1838.02 1.07361
7 1 1773.34 1.14263 9 1 1695.51 0.971866
7 2 1573.79 1.06715 9 2 1709.36 0.988575
7 3 1542.41 0.956475 9 3 1719.37 0.982937
9 0 1555.08 1. 7 0 1787.9 1.02266
9 1 1555.08 0.998252 7 1 1924.89 1.10649
9 2 1559.36 1.00299 7 2 1706.01 1.03175
9 3 1585.79 1.01582 7 3 1685.88 0.933633

6
sx3cal/EXFit.C Executable file → Normal file
View File

@ -1,6 +1,6 @@
{ {
int index = 1; int index = 9;
TFile *f = new TFile("../results_run19.root"); TFile *f = new TFile("../results_run10.root");
TH2F *h2=NULL; TH2F *h2=NULL;
TH1F *h1x=NULL, *h1y=NULL; TH1F *h1x=NULL, *h1y=NULL;
//f->cd("evsx"); //f->cd("evsx");
@ -11,7 +11,7 @@
std::ofstream ofb(Form("backgains%d.dat",index)); std::ofstream ofb(Form("backgains%d.dat",index));
std::ofstream off(Form("frontgains%d.dat",index)); std::ofstream off(Form("frontgains%d.dat",index));
for(int i=1; i<4; i++) { for(int i=0; i<4; i++) {
//do it for pad#2 //do it for pad#2
int backnum=2; int backnum=2;
h2 = (TH2F*)(f->Get(Form("evsx/be_vs_x_sx3_id_%d_f%d_b%d",index,i,backnum))); h2 = (TH2F*)(f->Get(Form("evsx/be_vs_x_sx3_id_%d_f%d_b%d",index,i,backnum)));

6
sx3cal/LRFit.C Executable file → Normal file
View File

@ -1,10 +1,10 @@
{ {
TFile *f = new TFile("../results_run19.root"); TFile *f = new TFile("../results_run10.root");
f->cd("l_vs_r"); f->cd("l_vs_r");
gDirectory->ls(); gDirectory->ls();
int clkpos = 13; int clkpos = 9;
std::ofstream ofile(Form("rightgains%d.dat",clkpos)); std::ofstream ofile(Form("rightgains%d.dat",clkpos));
for(int i=1; i<4; i++) { for(int i=0; i<4; i++) {
TH2F h2(*(TH2F*)(f->Get(Form("l_vs_r/l_vs_r_sx3_id_%d_f%d",clkpos,i)))); TH2F h2(*(TH2F*)(f->Get(Form("l_vs_r/l_vs_r_sx3_id_%d_f%d",clkpos,i))));
h2.Draw(); h2.Draw();

0
sx3cal/backgains.dat.unity Executable file → Normal file
View File

View File

@ -1,3 +1,4 @@
1 front 1 back 2 4.4094 1 front 0 back 2 4.1692
1 front 2 back 2 4.4832 1 front 1 back 2 4.13701
1 front 3 back 2 4.52103 1 front 2 back 2 4.26886
1 front 3 back 2 4.26886

6
sx3cal/backgains3.dat Normal file
View File

@ -0,0 +1,6 @@
3 front 1 back 2 3.31729
3 front 1 back 1 3.33796
3 front 2 back 2 3.35889
3 front 2 back 1 3.49018
3 front 3 back 2 3.38008
3 front 3 back 1 3.35889

8
sx3cal/backgains7.dat Normal file
View File

@ -0,0 +1,8 @@
7 front 0 back 2 3.25679
7 front 0 back 1 3.08785
7 front 1 back 2 3.25679
7 front 1 back 1 3.14218
7 front 2 back 2 3.29688
7 front 2 back 1 3.16072
7 front 3 back 2 3.29688
7 front 3 back 1 3.12386

View File

@ -1,6 +1,8 @@
9 front 1 back 2 3.58356 9 front 0 back 2 3.25679
9 front 1 back 1 3.44529 9 front 0 back 1 3.10575
9 front 2 back 2 3.58356 9 front 1 back 2 3.27671
9 front 2 back 1 3.46759 9 front 1 back 1 3.12386
9 front 3 back 2 3.63215 9 front 2 back 2 3.29688
9 front 3 back 1 3.46759 9 front 2 back 1 3.14218
9 front 3 back 2 3.29688
9 front 3 back 1 3.10575

0
sx3cal/frontgains.dat.unity Executable file → Normal file
View File

View File

@ -1,3 +1,4 @@
1 lengthcal front 1 1.5121 60.4839 1 lengthcal front 0 0.302419 60.4839
1 lengthcal front 2 -1.5625 62.5 1 lengthcal front 1 0.907258 60.4839
1 lengthcal front 3 2.72177 60.4839 1 lengthcal front 2 -2.11694 60.4839
1 lengthcal front 3 3.32661 60.4839

3
sx3cal/frontgains3.dat Normal file
View File

@ -0,0 +1,3 @@
3 lengthcal front 1 -0.302419 60.4839
3 lengthcal front 2 -3.12146 59.4564
3 lengthcal front 3 5.3066 62.4306

4
sx3cal/frontgains7.dat Normal file
View File

@ -0,0 +1,4 @@
7 lengthcal front 0 0.225805 45.1611
7 lengthcal front 1 1.85157 46.2892
7 lengthcal front 2 0.936622 46.8311
7 lengthcal front 3 3.65527 45.6909

View File

@ -1,3 +1,4 @@
9 lengthcal front 1 0.115732 46.2928 9 lengthcal front 0 2.10806 46.8457
9 lengthcal front 2 0.799176 45.6672 9 lengthcal front 1 0.694127 46.2751
9 lengthcal front 3 1.68159 48.0453 9 lengthcal front 2 1.04095 46.2646
9 lengthcal front 3 1.99048 46.8348

0
sx3cal/rightgains.dat.unity Executable file → Normal file
View File

View File

@ -1,3 +1,4 @@
1 1 1678.38 1.07163 1 0 1239.16 0.649287
1 2 1693.99 1.1035 1 1 1853.11 1.08968
1 3 1667.9 0.975015 1 2 1852.65 1.10279
1 3 1821.01 0.965101

3
sx3cal/rightgains3.dat Normal file
View File

@ -0,0 +1,3 @@
3 1 1749.6 1.01204
3 2 1954.81 1.23687
3 3 1751.15 0.904329

4
sx3cal/rightgains7.dat Normal file
View File

@ -0,0 +1,4 @@
7 0 1787.9 1.02266
7 1 1924.89 1.10649
7 2 1706.01 1.03175
7 3 1685.88 0.933633

View File

@ -1,3 +1,4 @@
9 1 1555.08 0.998252 9 0 1838.02 1.07361
9 2 1559.36 1.00299 9 1 1695.51 0.971866
9 3 1585.79 1.01582 9 2 1709.36 0.988575
9 3 1719.37 0.982937