Skip to content
Snippets Groups Projects
Commit ddeecd6f authored by moukaddam's avatar moukaddam
Browse files

Update energy thresholds, store partial matchsticked data for Ballis. Defic....

Update energy thresholds, store partial matchsticked data for Ballis. Defic. correction, teddy-up calibration
parent 049d6c2d
No related branches found
No related tags found
No related merge requests found
...@@ -52,15 +52,16 @@ ClassImp(TTiaraBarrelPhysics) ...@@ -52,15 +52,16 @@ ClassImp(TTiaraBarrelPhysics)
EventMultiplicity = 0 ; EventMultiplicity = 0 ;
m_EventData = new TTiaraBarrelData ; m_EventData = new TTiaraBarrelData ;
m_PreTreatedData = new TTiaraBarrelData ; m_PreTreatedData = new TTiaraBarrelData ;
m_PreTreatedMSData = new TTiaraBarrelData ;
m_EventPhysics = this ; m_EventPhysics = this ;
m_NumberOfDetector = 0 ; m_NumberOfDetector = 0 ;
m_Take_E_Strip= true; m_Take_E_Strip= true;
m_Take_T_Back=true; m_Take_T_Back=true;
m_Strip_E_Threshold = 0.40 ; m_Strip_E_Threshold = 10 ; //keV
m_Back_E_Threshold = 0.40 ; m_Back_E_Threshold = 10 ; //keV
m_Maximum_FrontBack_Difference = 0.4; m_Maximum_FrontBack_Difference = 30 ; // keV
m_OuterBack_E_Threshold =0; m_OuterBack_E_Threshold = 0;
m_Spectra = NULL ; m_Spectra = NULL ;
} }
...@@ -86,25 +87,52 @@ void TTiaraBarrelPhysics::BuildPhysicalEvent(){ ...@@ -86,25 +87,52 @@ void TTiaraBarrelPhysics::BuildPhysicalEvent(){
== m_PreTreatedData->GetFrontDownstreamEDetectorNbr(j) == m_PreTreatedData->GetFrontDownstreamEDetectorNbr(j)
&& m_PreTreatedData->GetFrontUpstreamEStripNbr(i) && m_PreTreatedData->GetFrontUpstreamEStripNbr(i)
== m_PreTreatedData->GetFrontDownstreamEStripNbr(j)) { == m_PreTreatedData->GetFrontDownstreamEStripNbr(j)) {
double ChU = Match_Strip_Upstream_E(i) ; // matchsticked int det = m_PreTreatedData->GetFrontUpstreamEDetectorNbr(i);
double ChD = Match_Strip_Downstream_E(j); // matchsticked int strip = m_PreTreatedData->GetFrontUpstreamEStripNbr(i) ;
double RowPos = (ChU-ChD)/(ChU+ChD); // order of U and D in numerator is crucial
double EU = m_PreTreatedData->GetFrontUpstreamEEnergy(i) ; // energy calibrated double EU = m_PreTreatedData->GetFrontUpstreamEEnergy(i) ; // energy calibrated
double ED = m_PreTreatedData->GetFrontDownstreamEEnergy(j); // energy calibrated double ED = m_PreTreatedData->GetFrontDownstreamEEnergy(j); // energy calibrated
double msU = m_PreTreatedMSData->GetFrontUpstreamEEnergy(i) ; // energy matchsticked
double msD = m_PreTreatedMSData->GetFrontDownstreamEEnergy(j); // energy matchsticked
double RowPos = (msU-msD)/(msU+msD);
//Calculate position
// Apply correction factor on RowPos
name = "TIARABARREL/B";
name+=NPL::itoa(det);
name+="_STRIP";
name+=NPL::itoa(strip);
name+="_POS";
double Pos = CalibrationManager::getInstance()
->ApplyResistivePositionCalibration(name,RowPos); // returns ((RowPos-d)/k)
//Fix Balistic deficit
// calibration is applied as: (U+D)*( 1 + BD*(pow(k,2)-pow(pos-d,2)) ),
// While BD > 0 and |k| >= |pos-d| for good events
//
// Get resistive shift and length, this will fix asymetries
double d = CalibrationManager::getInstance()->GetValue(name,0); // resistive strip length shift
double k = CalibrationManager::getInstance()->GetValue(name,1); // resistive strip half-length
name ="TIARABARREL/B";
name+=NPL::itoa(det);
name+="_STRIP";
name+=NPL::itoa(strip);
name+="_BALLISTIC";
double BD_x_k2 =CalibrationManager::getInstance()->ApplyCalibration(name, k );
double BD_x_Pos2 =CalibrationManager::getInstance()->ApplyCalibration(name, (RowPos-d) );
double BD = (BD_x_k2 - BD_x_Pos2);
DetectorNumber.push_back(det);
Strip_N.push_back(strip);
Strip_Pos.push_back(Pos); // position expressed in [-1;+1]
UpStream_E.push_back(EU);
DownStream_E.push_back(ED);
Strip_E.push_back( (EU+ED) * (1+BD) );
// Front back Energy match // Front back Energy match
/*
// check if back and front detectors are matched
if(true){ if(true){
name = "TIARABARREL/B";
name+=NPL::itoa(m_PreTreatedData->GetFrontUpstreamEDetectorNbr(i));
name+="_STRIP";
name+=NPL::itoa(m_PreTreatedData->GetFrontUpstreamEStripNbr(i));
name+="_POS";
double Pos = CalibrationManager::getInstance()
->ApplyResistivePositionCalibration(name,RowPos);
double d = CalibrationManager::getInstance()->GetValue(name,0); // resistive strip length shift
double k = CalibrationManager::getInstance()->GetValue(name,1); // resistive strip half-length
/*
double EO = -1000; double EO = -1000;
double EO1 = -500; double EO1 = -500;
double EO2 = -500; double EO2 = -500;
...@@ -122,24 +150,6 @@ void TTiaraBarrelPhysics::BuildPhysicalEvent(){ ...@@ -122,24 +150,6 @@ void TTiaraBarrelPhysics::BuildPhysicalEvent(){
} }
} }
} }
*/
UpStream_E.push_back(EU);
DownStream_E.push_back(ED);
Strip_Pos.push_back(Pos); // position expressed in [-1;+1]
Strip_N.push_back(m_PreTreatedData->GetFrontUpstreamEStripNbr(i));
DetectorNumber.push_back(m_PreTreatedData->GetFrontUpstreamEDetectorNbr(i));
name ="TIARABARREL/B";
name+=NPL::itoa(m_PreTreatedData->GetFrontUpstreamEDetectorNbr(i));
name+="_STRIP";
name+=NPL::itoa(m_PreTreatedData->GetFrontUpstreamEStripNbr(i));
name+="_BALLISTIC";
// calibration is applied as: (U+D)*( 1 - BD*( pow(k,2)-pow(pos-d,2) ) ), While BD < 0
// k is typically the max value of RowPos and is the same value used in the Position calibration
double BD_x_k2 =CalibrationManager::getInstance()->ApplyCalibration(name,fabs(k));
double BD_x_Pos2 =CalibrationManager::getInstance()->ApplyCalibration(name,fabs(RowPos-d));
//correction is multiplicative and used as perturbation on unit
Strip_E.push_back( (EU+ED) * (1-(BD_x_k2 - BD_x_Pos2)) );
/*
if(sizeO == 1) if(sizeO == 1)
EO = EO1; EO = EO1;
else if(sizeO == 2) else if(sizeO == 2)
...@@ -147,8 +157,9 @@ void TTiaraBarrelPhysics::BuildPhysicalEvent(){ ...@@ -147,8 +157,9 @@ void TTiaraBarrelPhysics::BuildPhysicalEvent(){
else else
EO = -1000; EO = -1000;
Outer_Strip_E.push_back(EO); Outer_Strip_E.push_back(EO);
*/
} // if true? } // if(true)
*/
} }
} // downstream } // downstream
} // upstream } // upstream
...@@ -166,20 +177,29 @@ void TTiaraBarrelPhysics::PreTreat(){ ...@@ -166,20 +177,29 @@ void TTiaraBarrelPhysics::PreTreat(){
unsigned int sizeD = m_EventData->GetFrontDownstreamEMult(); unsigned int sizeD = m_EventData->GetFrontDownstreamEMult();
unsigned int sizeB = m_EventData->GetBackEMult(); unsigned int sizeB = m_EventData->GetBackEMult();
unsigned int sizeO = m_EventData->GetOuterEMult(); unsigned int sizeO = m_EventData->GetOuterEMult();
for(unsigned int i = 0 ; i < sizeU ; i++){ for(unsigned int i = 0 ; i < sizeU ; i++){
double EU = Cal_Strip_Upstream_E(i) ; double EU = Cal_Strip_Upstream_E(i) ;
if(EU > m_Strip_E_Threshold) if(EU > m_Strip_E_Threshold){
m_PreTreatedData->SetFrontUpstreamE(m_EventData->GetFrontUpstreamEDetectorNbr(i), m_PreTreatedData->SetFrontUpstreamE(m_EventData->GetFrontUpstreamEDetectorNbr(i),
m_EventData->GetFrontUpstreamEStripNbr(i), m_EventData->GetFrontUpstreamEStripNbr(i),
EU); EU);
m_PreTreatedMSData->SetFrontUpstreamE(m_EventData->GetFrontUpstreamEDetectorNbr(i),
m_EventData->GetFrontUpstreamEStripNbr(i),
Match_Strip_Upstream_E(i));
}
} }
for(unsigned int j = 0 ; j < sizeD ; j++){ for(unsigned int j = 0 ; j < sizeD ; j++){
double ED = Cal_Strip_Downstream_E(j) ; double ED = Cal_Strip_Downstream_E(j) ;
if(ED>m_Strip_E_Threshold) if(ED>m_Strip_E_Threshold){
m_PreTreatedData->SetFrontDownstreamE(m_EventData->GetFrontDownstreamEDetectorNbr(j), m_PreTreatedData->SetFrontDownstreamE(m_EventData->GetFrontDownstreamEDetectorNbr(j),
m_EventData->GetFrontDownstreamEStripNbr(j), m_EventData->GetFrontDownstreamEStripNbr(j),
ED); ED);
m_PreTreatedMSData->SetFrontDownstreamE(m_EventData->GetFrontDownstreamEDetectorNbr(j),
m_EventData->GetFrontDownstreamEStripNbr(j),
Match_Strip_Downstream_E(j));
}
} }
for(unsigned int k = 0 ; k < sizeB ; k++){ for(unsigned int k = 0 ; k < sizeB ; k++){
...@@ -192,7 +212,8 @@ void TTiaraBarrelPhysics::PreTreat(){ ...@@ -192,7 +212,8 @@ void TTiaraBarrelPhysics::PreTreat(){
double EO = m_EventData->GetOuterEEnergy(l) ; double EO = m_EventData->GetOuterEEnergy(l) ;
if(EO > m_OuterBack_E_Threshold) if(EO > m_OuterBack_E_Threshold)
m_PreTreatedData->SetOuterE(m_EventData->GetOuterEDetectorNbr(l),m_EventData->GetOuterEStripNbr(l),EO); m_PreTreatedData->SetOuterE(m_EventData->GetOuterEDetectorNbr(l),m_EventData->GetOuterEStripNbr(l),EO);
} }
} }
//////////////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////////////
...@@ -431,9 +452,8 @@ TVector3 TTiaraBarrelPhysics::GetPositionOfInteraction(const int i) const{ ...@@ -431,9 +452,8 @@ TVector3 TTiaraBarrelPhysics::GetPositionOfInteraction(const int i) const{
double X = (Strip_N[i]*StripPitch-0.5*INNERBARREL_ActiveWafer_Width)-(0.5*StripPitch); double X = (Strip_N[i]*StripPitch-0.5*INNERBARREL_ActiveWafer_Width)-(0.5*StripPitch);
double Y = INNERBARREL_PCB_Width*(0.5+sin(45*deg)); double Y = INNERBARREL_PCB_Width*(0.5+sin(45*deg));
double Z = Strip_Pos[i]*(0.5*INNERBARREL_ActiveWafer_Length); double Z = Strip_Pos[i]*(0.5*INNERBARREL_ActiveWafer_Length);
//original version of the line above = double Z = (Strip_Pos[i]-0.5)*INNERBARREL_ActiveWafer_Length;
TVector3 POS(X,Y,-Z); // since RowPos = (U-D)/(U+D) => Downstream hit (i.e. Z>0) has RowPos<0, thus the sign TVector3 POS(X,Y,-Z); // since RowPos = (U-D)/(U+D) => Downstream hit (i.e. Z>0) has RowPos<0, thus the sign
POS.RotateZ((5-DetectorNumber[i])*45*deg);// looking downstream Detector 1 is at 3'oclock POS.RotateZ((5-DetectorNumber[i])*45*deg);// looking downstream Detector 1 is at 3 o'clock
return( POS ) ; return( POS ) ;
} }
/////////////////////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////////////////////
...@@ -478,8 +498,9 @@ double TTiaraBarrelPhysics::Cal_Strip_Upstream_E(const int i){ ...@@ -478,8 +498,9 @@ double TTiaraBarrelPhysics::Cal_Strip_Upstream_E(const int i){
name+= "_UPSTREAM" ; name+= "_UPSTREAM" ;
name+= NPL::itoa( m_EventData->GetFrontUpstreamEStripNbr(i) ) ; name+= NPL::itoa( m_EventData->GetFrontUpstreamEStripNbr(i) ) ;
name+= "_E"; name+= "_E";
return CalibrationManager::getInstance()->ApplyCalibration(name, double MSEnergy = Match_Strip_Upstream_E(i);
Match_Strip_Upstream_E(i) ); double CalEnergy = CalibrationManager::getInstance()->ApplyCalibration(name,MSEnergy);
return CalEnergy ;
} }
/////////////////////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////////////////////
double TTiaraBarrelPhysics::Cal_Strip_Downstream_E(const int i){ double TTiaraBarrelPhysics::Cal_Strip_Downstream_E(const int i){
...@@ -488,8 +509,9 @@ double TTiaraBarrelPhysics::Cal_Strip_Downstream_E(const int i){ ...@@ -488,8 +509,9 @@ double TTiaraBarrelPhysics::Cal_Strip_Downstream_E(const int i){
name+= "_DOWNSTREAM" ; name+= "_DOWNSTREAM" ;
name+= NPL::itoa( m_EventData->GetFrontDownstreamEStripNbr(i) ) ; name+= NPL::itoa( m_EventData->GetFrontDownstreamEStripNbr(i) ) ;
name+= "_E"; name+= "_E";
return CalibrationManager::getInstance()->ApplyCalibration(name, double MSEnergy = Match_Strip_Downstream_E(i);
Match_Strip_Downstream_E(i) ); double CalEnergy = CalibrationManager::getInstance()->ApplyCalibration(name, MSEnergy);
return CalEnergy ;
} }
/////////////////////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////////////////////
double TTiaraBarrelPhysics::Match_Strip_Upstream_E(const int i){ double TTiaraBarrelPhysics::Match_Strip_Upstream_E(const int i){
...@@ -498,8 +520,9 @@ double TTiaraBarrelPhysics::Match_Strip_Upstream_E(const int i){ ...@@ -498,8 +520,9 @@ double TTiaraBarrelPhysics::Match_Strip_Upstream_E(const int i){
name+= "_UPSTREAM" ; name+= "_UPSTREAM" ;
name+= NPL::itoa( m_EventData->GetFrontUpstreamEStripNbr(i) ) ; name+= NPL::itoa( m_EventData->GetFrontUpstreamEStripNbr(i) ) ;
name+= "_MATCHSTICK"; name+= "_MATCHSTICK";
return CalibrationManager::getInstance()->ApplyCalibration(name, double RawEnergy = m_EventData->GetFrontUpstreamEEnergy(i);
m_EventData->GetFrontUpstreamEEnergy(i) ); double MSEnergy = CalibrationManager::getInstance()->ApplyCalibration(name,RawEnergy);
return MSEnergy ;
} }
/////////////////////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////////////////////
double TTiaraBarrelPhysics::Match_Strip_Downstream_E(const int i){ double TTiaraBarrelPhysics::Match_Strip_Downstream_E(const int i){
...@@ -508,8 +531,9 @@ double TTiaraBarrelPhysics::Match_Strip_Downstream_E(const int i){ ...@@ -508,8 +531,9 @@ double TTiaraBarrelPhysics::Match_Strip_Downstream_E(const int i){
name+= "_DOWNSTREAM" ; name+= "_DOWNSTREAM" ;
name+= NPL::itoa( m_EventData->GetFrontDownstreamEStripNbr(i) ) ; name+= NPL::itoa( m_EventData->GetFrontDownstreamEStripNbr(i) ) ;
name+= "_MATCHSTICK"; name+= "_MATCHSTICK";
return CalibrationManager::getInstance()->ApplyCalibration(name, double RawEnergy = m_EventData->GetFrontDownstreamEEnergy(i);
m_EventData->GetFrontDownstreamEEnergy(i) ); double MSEnergy = CalibrationManager::getInstance()->ApplyCalibration(name,RawEnergy);
return MSEnergy;
} }
/////////////////////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////////////////////
double TTiaraBarrelPhysics::Cal_Back_E(const int i){ double TTiaraBarrelPhysics::Cal_Back_E(const int i){
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment