Commit e5d8d823 authored by Adrien Matta's avatar Adrien Matta
Browse files

* Progress on s034 analysis

        - adding macros for comparing the two analysis
        - tweaking position
        - tweaking DC reconsctruction algorithm
parent e066a96a
Pipeline #120766 passed with stages
in 7 minutes and 8 seconds
......@@ -154,7 +154,7 @@ void TSamuraiBDCPhysics::BuildPhysicalEvent(){
//cout << "BDC" << endl;
m_reconstruction.ResolvePlane(it1->second,it1->first,it2->second,it2->first,P);
// cout << "done " << D[it1->first] << " " << D[it2->first] << endl;
if(P.X()!=-10000 && D[it1->first]<PowerThreshold&& D[it2->first]<PowerThreshold){
if(P.X()!=-10000 /*&& D[it1->first]<PowerThreshold&& D[it2->first]<PowerThreshold*/){
C.push_back(P);
// Mean pos are weighted based on the the sum of distance from track
// to hit obtained during the minimisation
......@@ -172,7 +172,7 @@ void TSamuraiBDCPhysics::BuildPhysicalEvent(){
if(it1!=it2 ){// different plane, same detector
m_reconstruction.ResolvePlane(it1->second,it1->first,it2->second,it2->first,P);
if(P.X()!=-10000&& D[it1->first]<PowerThreshold && D[it2->first]<PowerThreshold)
if(P.X()!=-10000/*&& D[it1->first]<PowerThreshold && D[it2->first]<PowerThreshold*/)
C100.push_back(P);
}
}
......@@ -272,7 +272,10 @@ void TSamuraiBDCPhysics::PreTreat(){
if(etime && time && etime-time>ToTThreshold_L && etime-time<ToTThreshold_H){
channel="SamuraiBDC"+NPL::itoa(det)+"/L" + NPL::itoa(layer);
SamuraiDCIndex idx(det,layer,wire);
m_DCHit[det].push_back(DCHit(det,layer,wire,time,etime-time,2.5-Cal->ApplySigmoid(channel,etime)));
if(!m_invertD[det])
m_DCHit[det].push_back(DCHit(det,layer,wire,time,etime-time,Cal->ApplySigmoid(channel,etime)));
else
m_DCHit[det].push_back(DCHit(det,layer,wire,time,etime-time,2.5-Cal->ApplySigmoid(channel,etime)));
}
}
}
......@@ -303,7 +306,7 @@ void TSamuraiBDCPhysics::ReadConfiguration(NPL::InputParser parser){
if(NPOptionManager::getInstance()->GetVerboseLevel())
cout << "//// " << blocks.size() << " detector(s) found " << endl;
vector<string> token= {"XML","Offset","InvertX","InvertY"};
vector<string> token= {"XML","Offset","InvertX","InvertY","InvertD"};
for(unsigned int i = 0 ; i < blocks.size() ; i++){
if(blocks[i]->HasTokenList(token)){
......@@ -316,9 +319,11 @@ void TSamuraiBDCPhysics::ReadConfiguration(NPL::InputParser parser){
TVector3 offset = blocks[i]->GetTVector3("Offset","mm");
bool invertX = blocks[i]->GetInt("InvertX");
bool invertY = blocks[i]->GetInt("InvertY");
bool invertD = blocks[i]->GetInt("InvertD");
m_offset[det] = offset;
m_invertX[det] = invertX;
m_invertY[det] = invertY;
m_invertD[det] = invertD;
}
}
......
......@@ -199,6 +199,7 @@ class TSamuraiBDCPhysics : public TObject, public NPL::VDetector{
std::map<unsigned int, TVector3> m_offset;//!
std::map<unsigned int, bool> m_invertX;//!
std::map<unsigned int, bool> m_invertY;//!
std::map<unsigned int, bool> m_invertD;//!
private: // Spectra Class
// TSamuraiBDCSpectra* m_Spectra; // !
......
......@@ -46,11 +46,14 @@ ClassImp(TSamuraiFDC0Physics)
m_PreTreatedData = new TSamuraiFDC0Data ;
m_EventPhysics = this ;
//m_Spectra = NULL;
// ToTThreshold_L = 0;
// ToTThreshold_H = 180;
ToTThreshold_L = 0;
ToTThreshold_H = 180;
ToTThreshold_H = 10000;
DriftLowThreshold=0.1 ;
DriftUpThreshold=2.4;
PowerThreshold=5;
PowerThreshold=15;
}
///////////////////////////////////////////////////////////////////////////
......@@ -107,9 +110,9 @@ void TSamuraiFDC0Physics::BuildPhysicalEvent(){
#if __cplusplus > 199711L && NPMULTITHREADING
D[it->first]=m_reconstruction.GetResults(uid++,X0,X100,a,b);
#endif
/*
// for Debug, write a file of
/* { std::ofstream f("distance.txt", std::ios::app);
{ std::ofstream f("distance.txt", std::ios::app);
f<< D[it->first] << endl;
f.close();
}
......@@ -141,7 +144,7 @@ void TSamuraiFDC0Physics::BuildPhysicalEvent(){
//cout << "FDC0" << endl;
m_reconstruction.ResolvePlane(it1->second,it1->first,it2->second,it2->first,P);
// cout << "done " << D[it1->first] << " " << D[it2->first] << endl;
if(P.X()!=-10000 && D[it1->first]<PowerThreshold&& D[it2->first]<PowerThreshold){
if(P.X()!=-10000/* && D[it1->first]<PowerThreshold&& D[it2->first]<PowerThreshold*/){
C.push_back(P);
// Mean pos are weighted based on the the sum of distance from track
// to hit obtained during the minimisation
......@@ -158,7 +161,7 @@ void TSamuraiFDC0Physics::BuildPhysicalEvent(){
if(it1!=it2 ){// different plane, same detector
m_reconstruction.ResolvePlane(it1->second,it1->first,it2->second,it2->first,P);
if(P.X()!=-10000&& D[it1->first]<PowerThreshold && D[it2->first]<PowerThreshold)
if(P.X()!=-10000/*&& D[it1->first]<PowerThreshold && D[it2->first]<PowerThreshold*/)
C100.push_back(P);
}
}
......@@ -180,10 +183,12 @@ void TSamuraiFDC0Physics::BuildPhysicalEvent(){
PosY100+= C100[i].Y()*W[i];
norm+=W[i];
}
MultMean=size;
// Mean position at Z=0
PosX=PosX/norm;
PosY=PosY/norm;
// Mean position at Z=100
PosX100=PosX100/norm;
PosY100=PosY100/norm;
......@@ -196,15 +201,28 @@ void TSamuraiFDC0Physics::BuildPhysicalEvent(){
}
devX=sqrt(devX/((size-1)*norm));
devY=sqrt(devY/((size-1)*norm));
if(m_invertX){
PosX*=-1;
PosX100*=-1;
}
if(m_invertY){
PosY*=-1;
PosY100*=-1;
}
// Compute ThetaX, angle between the Direction vector projection in XZ with
// the Z axis
//ThetaX=atan((PosX100-PosX)/100.);
ThetaX = (PosX100-PosX)/100.;
ThetaX=atan((PosX100-PosX)/100.);
//ThetaX = (PosX100-PosX)/100.;
// Compute PhiY, angle between the Direction vector projection in YZ with
// the Z axis
//PhiY=atan((PosY100-PosY)/100.);
PhiY=(PosY100-PosY)/100.;
PhiY=atan((PosY100-PosY)/100.);
//PhiY=(PosY100-PosY)/100.;
Dir=TVector3(PosX100-PosX,PosY100-PosY,100).Unit();
PosX+=m_offset.X();
PosY+=m_offset.Y();
}
return;
......@@ -253,7 +271,10 @@ void TSamuraiFDC0Physics::PreTreat(){
Time.push_back(time);
ToT.push_back(etime-time);
channel="SamuraiFDC0/L" + NPL::itoa(layer);
DriftLength.push_back(2.5-Cal->ApplySigmoid(channel,etime));
if(!m_invertD)
DriftLength.push_back(Cal->ApplySigmoid(channel,etime));
else
DriftLength.push_back(2.5-Cal->ApplySigmoid(channel,etime));
}
}
......@@ -306,6 +327,7 @@ void TSamuraiFDC0Physics::Clear(){
PileUp=0;
Mult=0;
PosX=PosY=-10000;
ThetaX=PhiY=-10000;
devX=devY=-10000;
DriftLength.clear();
Detector.clear();
......@@ -327,7 +349,7 @@ void TSamuraiFDC0Physics::ReadConfiguration(NPL::InputParser parser){
if(NPOptionManager::getInstance()->GetVerboseLevel())
cout << "//// " << blocks.size() << " detector(s) found " << endl;
vector<string> token= {"XML"};
vector<string> token= {"XML","Offset","InvertX","InvertY","InvertD"};
for(unsigned int i = 0 ; i < blocks.size() ; i++){
cout << endl << "//// Samurai FDC0 (" << i+1 << ")" << endl;
......@@ -335,6 +357,10 @@ void TSamuraiFDC0Physics::ReadConfiguration(NPL::InputParser parser){
NPL::XmlParser xml;
xml.LoadFile(xmlpath);
AddDC("SAMURAIFDC0",xml);
m_offset = blocks[i]->GetTVector3("Offset","mm");
m_invertX = blocks[i]->GetInt("InvertX");
m_invertY = blocks[i]->GetInt("InvertY");
m_invertD = blocks[i]->GetInt("InvertD");
}
#if __cplusplus > 199711L && NPMULTITHREADING
......
......@@ -181,6 +181,11 @@ class TSamuraiFDC0Physics : public TObject, public NPL::VDetector{
TSamuraiFDC0Data* m_PreTreatedData;//!
TSamuraiFDC0Physics* m_EventPhysics;//!
private: // offset and inversion
TVector3 m_offset;//!
bool m_invertX;//!
bool m_invertY;//!
bool m_invertD;//!
private: // Spectra Class
// TSamuraiFDC0Spectra* m_Spectra; // !
......
......@@ -44,11 +44,15 @@ ClassImp(TSamuraiFDC2Physics)
m_EventData = new TSamuraiFDC2Data ;
m_EventPhysics = this ;
//m_Spectra = NULL;
ToTThreshold_L = 180;
ToTThreshold_H = 1000;
DriftLowThreshold=0.4;
DriftUpThreshold=9.3;
PowerThreshold=14;
// ToTThreshold_L = 180;
// ToTThreshold_H = 1000;
ToTThreshold_L = 0;
ToTThreshold_H = 10000;
DriftLowThreshold=0.1;
DriftUpThreshold=9.9;
//PowerThreshold=15;
PowerThreshold=1e6;
}
///////////////////////////////////////////////////////////////////////////
......@@ -110,14 +114,14 @@ void TSamuraiFDC2Physics::BuildPhysicalEvent(){
D[it->first]=m_reconstruction.GetResults(uid++,X0,X100,a,b);
#endif
/* // for Debug, write a file of
/* // for Debug, write a file of
{ std::ofstream f("distance.txt", std::ios::app);
f<< D[it->first] << endl;
f.close();
}
*/
// very large a means track perpendicular to the chamber, what happen when there is pile up
if(abs(a)>5000)
*/
// very large a means track perpendicular to the chamber, what happen when there is pile up
if(abs(a)>5000)
PileUp++;
Mult+=X[it->first].size();
......@@ -141,8 +145,7 @@ void TSamuraiFDC2Physics::BuildPhysicalEvent(){
for(auto it2 = it1;it2!=VX0.end();++it2){
if(it1!=it2){// different plane, same detector
m_reconstruction.ResolvePlane(it1->second,it1->first,it2->second,it2->first,P);
if(P.X()!=-10000 && D[it1->first]<PowerThreshold && D[it2->first]<PowerThreshold){
if(P.X()!=-10000 /*&& D[it1->first]<PowerThreshold && D[it2->first]<PowerThreshold*/){
C.push_back(P);
// Mean pos are weighted based on the the sum of distance from track
// to hit obtained during the minimisation
......@@ -151,7 +154,7 @@ void TSamuraiFDC2Physics::BuildPhysicalEvent(){
}
}
}
// Reconstruct the position at z=100 for each detector
static vector<TVector3> C100 ;
C100.clear();
......@@ -160,7 +163,7 @@ void TSamuraiFDC2Physics::BuildPhysicalEvent(){
if(it1!=it2){// different plane
m_reconstruction.ResolvePlane(it1->second,it1->first,it2->second,it2->first,P);
if(P.X()!=-10000&& D[it1->first]<PowerThreshold && D[it2->first]<PowerThreshold)
if(P.X()!=-10000/*&& D[it1->first]<PowerThreshold && D[it2->first]<PowerThreshold*/)
C100.push_back(P);
}
}
......@@ -202,6 +205,16 @@ void TSamuraiFDC2Physics::BuildPhysicalEvent(){
devX=sqrt(devX/((size-1)*norm));
devY=sqrt(devY/((size-1)*norm));
if(m_invertX){
PosX*=-1;
PosX100*=-1;
}
if(m_invertY){
PosY*=-1;
PosY100*=-1;
}
// Compute ThetaX, angle between the Direction vector projection in XZ with
// the Z axis
......@@ -212,8 +225,13 @@ void TSamuraiFDC2Physics::BuildPhysicalEvent(){
//PhiY=atan((PosY100-PosY)/100.);
PhiY=(PosY100-PosY)/100.;
Dir=TVector3(PosX100-PosX,PosY100-PosY,100).Unit();
PosX+=m_offset.X();
PosY+=m_offset.Y();
}
//cout <<size << " " << PosX << endl;
/* if(PosX==-10000)
cout << " bad " << Detector.size()<< " " << size << endl;
else
cout << " okay" << Detector.size()<< " " << size << endl;*/
return;
}
///////////////////////////////////////////////////////////////////////////
......@@ -258,7 +276,10 @@ void TSamuraiFDC2Physics::PreTreat(){
channel="SamuraiFDC2/L" + NPL::itoa(layer);
// rescalling is needed because calib are bad.
// to be fixed
DriftLength.push_back(10-Cal->ApplySigmoid(channel,etime));
if(!m_invertD)
DriftLength.push_back(Cal->ApplySigmoid(channel,etime));
else
DriftLength.push_back(10-Cal->ApplySigmoid(channel,etime));
}
}
}
......@@ -329,6 +350,7 @@ void TSamuraiFDC2Physics::Clear(){
PileUp=0;
Mult=0;
PosX=PosY=-10000;
ThetaX=PhiY=-10000;
devX=devY=-10000;
DriftLength.clear();
Detector.clear();
......@@ -350,7 +372,7 @@ void TSamuraiFDC2Physics::ReadConfiguration(NPL::InputParser parser){
if(NPOptionManager::getInstance()->GetVerboseLevel())
cout << "//// " << blocks.size() << " detector(s) found " << endl;
vector<string> token= {"XML"};
vector<string> token= {"XML","Offset","InvertX","InvertY","InvertD"};
for(unsigned int i = 0 ; i < blocks.size() ; i++){
cout << endl << "//// Samurai FDC2 (" << i+1 << ")" << endl;
......@@ -358,6 +380,10 @@ void TSamuraiFDC2Physics::ReadConfiguration(NPL::InputParser parser){
NPL::XmlParser xml;
xml.LoadFile(xmlpath);
AddDC("SAMURAIFDC2",xml);
m_offset = blocks[i]->GetTVector3("Offset","mm");
m_invertX = blocks[i]->GetInt("InvertX");
m_invertY = blocks[i]->GetInt("InvertY");
m_invertD = blocks[i]->GetInt("InvertD");
}
......
......@@ -176,6 +176,11 @@ class TSamuraiFDC2Physics : public TObject, public NPL::VDetector{
TSamuraiFDC2Data* m_EventData;//!
TSamuraiFDC2Physics* m_EventPhysics;//!
private: // offset and inversion
TVector3 m_offset;//!
bool m_invertX;//!
bool m_invertY;//!
bool m_invertD;//!
private: // Spectra Class
// TSamuraiFDC2Spectra* m_Spectra; // !
......
......@@ -126,8 +126,8 @@ namespace NPL {
void SetSpinParity(const char* spinparity) {fSpinParity = spinparity;}
void SetSpin(double spin) {fSpin = spin;}
void SetParity(const char* parity) {fParity = parity;}
void SetLifeTime(double LifeTime) {fLifeTime=LifeTime;}
void SetLifeTimeError(double LifeTimeErr) {fLifeTimeErr=LifeTimeErr;}
void SetLifeTime(double LifeTime) {fLifeTime=LifeTime;}
void SetLifeTimeError(double LifeTimeErr) {fLifeTimeErr=LifeTimeErr;}
void SetKineticEnergy(double energy) {fKineticEnergy = energy; EnergyToBrho(); EnergyToTof(); EnergyToBeta(); BetaToGamma();BetaToVelocity();}
void SetBrho(double brho) {fBrho = brho; BrhoToEnergy(); BrhoToTof(); EnergyToBeta(); BetaToGamma();BetaToVelocity();}
void SetTimeOfFlight(double tof) {fTimeOfFlight = tof; TofToEnergy(); TofToBrho(); EnergyToBeta(); BetaToGamma();BetaToVelocity();}
......
......@@ -236,13 +236,9 @@ void DCReconstructionMT::StartThread(unsigned int id){
// Define the starting point of the fit: a straight line passing through the
// the first and last wire
// z = ax+b -> x=(z-b)/a
unsigned int i = 1;
ai=1/0.;
while(isinf(ai)&&i!=sizeX[id]){
ai = ((*fitZ[id])[sizeX[id]-i]-(*fitZ[id])[0])/((*fitX[id])[sizeX[id]-i]-(*fitX[id])[0]);
bi = (*fitZ[id])[0]-ai*((*fitX[id])[0]);
i++;
}
ai = ((*fitZ[id])[sizeX[id]-1]-(*fitZ[id])[0])/((*fitX[id])[sizeX[id]-1]-(*fitX[id])[0]+(*fitR[id])[sizeX[id]-1]-(*fitR[id])[0]);
bi = (*fitZ[id])[0]-ai*((*fitX[id])[0]+(*fitR[id])[0]);
if(isinf(ai)){ // then there is no two point in different layer
m_a[uid]=-10000;
m_b[uid]=-10000;
......@@ -250,6 +246,7 @@ void DCReconstructionMT::StartThread(unsigned int id){
m_X100[uid]=-10000;
m_minimum[uid] = 10000;
}
else{
mini->Clear();
mini->SetVariable(0,"a",ai,1);
......
......@@ -54,13 +54,19 @@ void Analysis::TreatEvent(){
//cout << Trigger << " " ;
Trigger=Trigger&0x00ff;
//cout << Trigger << endl;
// Compute Broh
if(FDC2->PosX>-10000 && FDC0->PosX>-10000){ // if both are correctly build
double broh_param[6]={FDC0->PosX, FDC0->PosY, tan(FDC0->ThetaX), tan(FDC0->PhiY), FDC2->PosX, FDC2->ThetaX};
// Compute Brho
if(FDC2->PosX>-10000 && FDC0->PosX>-10000 ){ // if both are correctly build
// Compute ThetaX and PhiY using Minos vertex and FDC0 XY
double FDC0_ThetaX = FDC0->ThetaX;
double FDC0_PhiY = FDC0->PhiY;
Broh=r_fit(broh_param);
if(Minos->Z_Vertex>0){
FDC0_ThetaX = atan((FDC0->PosX-Minos->X_Vertex)/(1283.7-Minos->Z_Vertex));
FDC0_PhiY = atan((FDC0->PosY-Minos->Y_Vertex)/(1283.7-Minos->Z_Vertex));
}
double brho_param[6]={FDC0->PosX/*+1.77*/, FDC0->PosY, tan(FDC0_ThetaX), tan(FDC0_PhiY), FDC2->PosX/*-252.55*/, FDC2->ThetaX};
Brho=r_fit(brho_param);
}
}
////////////////////////////////////////////////////////////////////////////////
......@@ -69,13 +75,13 @@ void Analysis::End(){
////////////////////////////////////////////////////////////////////////////////
void Analysis::Clear(){
Broh=-1000;
Brho=-1000;
Beta_f=-1000;
}
////////////////////////////////////////////////////////////////////////////////
void Analysis::InitOutputBranch() {
RootOutput::getInstance()->GetTree()->Branch("Broh",&Broh,"Broh/D");
RootOutput::getInstance()->GetTree()->Branch("Brho",&Brho,"Brho/D");
RootOutput::getInstance()->GetTree()->Branch("Beta_f",&Beta_f,"Beta_f/D");
RootOutput::getInstance()->GetTree()->Branch("Trigger",&Trigger,"Trigger/I");
}
......
......@@ -50,7 +50,7 @@ class Analysis: public NPL::VAnalysis{
TSamuraiHodoscopePhysics* Hodo;
private: // output variable
double Broh;
double Brho;
double Beta_f;
int Trigger;
public:
......
void IDz(){
auto fz = new TFile("root/zaihong/run0582_RIG20210424_6He.root");
auto tz = (TTree*) fz->FindObjectAny("rig");
tz->Draw("rig/1000.>>h(1000,0,8)","","");
tz->Draw("rig/1000.>>hn(1000,0,8)","FragID==-1","same");
tz->Draw("rig/1000.>>hd(1000,0,8)","FragID==12","same");
tz->Draw("rig/1000.>>ht(1000,0,8)","FragID==13","same");
tz->Draw("rig/1000.>>h4He(1000,0,8)","FragID==24","same");
tz->Draw("rig/1000.>>h6He(1000,0,8)","FragID==26","same");
auto hn = (TH1*) gDirectory->FindObjectAny("hn");
auto hd = (TH1*) gDirectory->FindObjectAny("hd");
auto ht = (TH1*) gDirectory->FindObjectAny("ht");
auto h4He = (TH1*) gDirectory->FindObjectAny("h4He");
auto h6He = (TH1*) gDirectory->FindObjectAny("h6He");
hn->SetFillStyle(1001);
hd ->SetFillStyle(1001);
ht ->SetFillStyle(1001);
h4He ->SetFillStyle(1001);
h6He ->SetFillStyle(1001);
hn->SetFillColor(kBlack);
hd ->SetFillColor(kAzure+7);
ht ->SetFillColor(kOrange+7);
h4He ->SetFillColor(kGreen-3);
h6He ->SetFillColor(kMagenta-3);
hn->SetLineColor(kBlack);
hd ->SetLineColor(kAzure+7);
ht ->SetLineColor(kOrange+7);
h4He ->SetLineColor(kGreen-3);
h6He ->SetLineColor(kMagenta-3);
gPad->Update();
}
void compare(){
auto fz = new TFile("root/zaihong/run0582_RIG20210424_6He.root");
auto tz = (TTree*) fz->FindObjectAny("rig");
auto fl = new TFile("root/analysis/test582.root");
auto tl = (TTree*) fl->FindObjectAny("PhysicsTree");
tl->AddFriend(tz);
auto cfdc0= new TCanvas();
cfdc0->Divide(2,4);
cfdc0->cd(1);
tz->Draw("FDC0_X>>h1(1000,-80,80)","FDC0_X>-80 && FDC0_X<80");
cfdc0->cd(2);
tz->Draw("FDC0_Y>>h2(1000,-80,80)","FDC0_X>-80 && FDC0_Y<80");
cfdc0->cd(3);
tl->Draw("SamuraiFDC0.PosX>>h3(1000,-80,80)","SamuraiFDC0.PosX>-80 && SamuraiFDC0.PosX<80");
cfdc0->cd(4);
tl->Draw("SamuraiFDC0.PosY>>h4(1000,-80,80)","SamuraiFDC0.PosY>-80 && SamuraiFDC0.PosY<80");
cfdc0->cd(5);
tl->Draw("SamuraiFDC0.PosX:FDC0_X>>h5(1000,-80,80,1000,-80,80)","SamuraiFDC0.PosX>-80 && SamuraiFDC0.PosX<80","colz");
auto l = new TLine(-80,-80,80,80);
l->SetLineColor(kOrange+7);
l->SetLineWidth(2);
l->Draw();
cfdc0->cd(6);
tl->Draw("SamuraiFDC0.PosY:FDC0_Y>>h6(1000,-80,80,1000,-80,80)","SamuraiFDC0.PosY>-80 && SamuraiFDC0.PosY<80","colz");
l->Draw();
cfdc0->cd(7);
tl->Draw("SamuraiFDC0.PosX-FDC0_X>>h7(1000,-5,5)","SamuraiFDC0.PosX>-80 && SamuraiFDC0.PosX<80","");
cfdc0->cd(8);
tl->Draw("SamuraiFDC0.PosY-FDC0_Y>>h8(1000,-5,5)","SamuraiFDC0.PosY>-80 && SamuraiFDC0.PosY<80","");
auto cfdc2= new TCanvas();
cfdc2->Divide(2,4);
cfdc2->cd(1);
tz->Draw("FDC2_X>>g1(1000,-2000,2000)","FDC2_X>-2000 && FDC2_X<2000");
cfdc2->cd(2);
tz->Draw("FDC2_Y>>g2(1000,-2000,2000)","FDC2_X>-2000 && FDC2_Y<2000");
cfdc2->cd(3);
tl->Draw("SamuraiFDC2.PosX>>g3(1000,-2000,2000)","SamuraiFDC2.PosX>-2000 && SamuraiFDC2.PosX<2000&&SamuraiFDC2.devX<10");
cfdc2->cd(4);
tl->Draw("SamuraiFDC2.PosY>>g4(1000,-2000,2000)","SamuraiFDC2.PosY>-2000 && SamuraiFDC2.PosY<2000&&SamuraiFDC2.devY<10");
cfdc2->cd(5);
tl->Draw("SamuraiFDC2.PosX:FDC2_X>>g5(1000,-2000,2000,1000,-2000,2000)","SamuraiFDC2.PosX>-2000 && SamuraiFDC2.PosX<2000&&SamuraiFDC2.devX<10","colz");
l = new TLine(-2000,-2000,2000,2000);
l->SetLineColor(kOrange+7);
l->SetLineWidth(2);
l->Draw();
cfdc2->cd(6);
tl->Draw("SamuraiFDC2.PosY:FDC2_Y>>g6(1000,-2000,2000,1000,-2000,2000)","SamuraiFDC2.PosY>-2000 && SamuraiFDC2.PosY<2000&&SamuraiFDC2.devX<10","colz");
l->Draw();
cfdc2->cd(7);
tl->Draw("SamuraiFDC2.PosX-FDC2_X>>g7(1000,-5,5)","SamuraiFDC2.PosX>-2000 && SamuraiFDC2.PosX<2000&&SamuraiFDC2.devX<10","");
cfdc2->cd(8);
tl->Draw("SamuraiFDC2.PosY-FDC2_Y>>g8(1000,-5,5)","SamuraiFDC2.PosY>-2000 && SamuraiFDC2.PosY<2000&&SamuraiFDC2.devY<10","");
auto cfdc2b= new TCanvas();
cfdc2b->Divide(2,4);
cfdc2b->cd(1);
tz->Draw("FDC2_ThetaX>>i1(1000,-2,2)","FDC2_ThetaX>-1000");
cfdc2b->cd(2);
tz->Draw("FDC2_ThetaY>>i2(1000,-2,2)","FDC2_ThetaY>-1000");
cfdc2b->cd(3);
tl->Draw("SamuraiFDC2.ThetaX>>i3(1000,-2,2)","SamuraiFDC2.ThetaX>-10000");
cfdc2b->cd(4);
tl->Draw("SamuraiFDC2.PhiY>>i4(1000,-2,2)","SamuraiFDC2.PhiY>-1000");
cfdc2b->cd(5);
tl->Draw("SamuraiFDC2.ThetaX:FDC2_ThetaX>>i5(1000,-2,2,1000,-2,2)","FDC2_ThetaX>-1000&&SamuraiFDC2.ThetaX>-10000","colz");
l = new TLine(-2,-2,2,2);
l->SetLineColor(kOrange+7);
l->SetLineWidth(2);
l->Draw();
cfdc2b->cd(6);
tl->Draw("SamuraiFDC2.PhiY:FDC2_ThetaY>>i6(1000,-2,2,1000,-2,2)","FDC2_ThetaY>-1000&&SamuraiFDC2.PhiY>-1000","colz");
l->Draw();
cfdc2b->cd(7);
tl->Draw("SamuraiFDC2.ThetaX-FDC2_ThetaX>>i7(1000,-0.1,0.1)","FDC2_ThetaX>-1000&&SamuraiFDC2.ThetaX>-10000","");
cfdc2b->cd(8);
tl->Draw("SamuraiFDC2.PhiY-FDC2_ThetaY>>i8(1000,-0.1,0.1)","FDC2_ThetaY>-1000&&SamuraiFDC2.PhiY>-1000","");
auto cbroh= new TCanvas();
cbroh->Divide(2,2);
cbroh->cd(1);
tl->Draw("Brho>>b1(1000,0,8)","Brho>0 && SamuraiFDC2.devX<10 && SamuraiFDC2.devX<10");
cbroh->cd(2);
tz->Draw("rig>>b2(1000,0,8000)","rig>0");
cbroh->cd(3);
tl->Draw("Brho:rig/1000.>>b3(1000,0,8,1000,0,8)","rig>0 && Brho>0","colz");
l = new TLine(0,0,8,8);
l->SetLineColor(kOrange+7);
l->SetLineWidth(2);
l->Draw();
cbroh->cd(4);
tz->Draw("rig/1000.:FragID>>b4(1000,-2000,2000,31,-1,30)","","colz");
}
......@@ -2,7 +2,7 @@ void dist(){
ifstream f("distance.txt");
double d;
auto h = new TH1D("h","h",1000,0,10);
auto h = new TH1D("h","h",1000,0,100);
while(f>>d){
h->Fill(d);
......