Skip to content
This repository has been archived by the owner on Aug 27, 2024. It is now read-only.

Commit

Permalink
Adding variables/functions to handle time from TACS
Browse files Browse the repository at this point in the history
  • Loading branch information
moukaddam committed Dec 6, 2016
1 parent f579868 commit b83e569
Show file tree
Hide file tree
Showing 4 changed files with 38 additions and 6 deletions.
27 changes: 23 additions & 4 deletions NPLib/Detectors/FPDTamu/TFPDTamuPhysics.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ void TFPDTamuPhysics::BuildPhysicalEvent() {

unsigned int mysizeT = m_PreTreatedData->Get_Micro_Time_Mult();
for (UShort_t t = 0; t< mysizeT ; t++) {
MicroTime.push_back(m_EventData->Get_Micro_Time(t));
MicroTimeOR.push_back(m_EventData->Get_Micro_Time(t));
}

//AWire
Expand Down Expand Up @@ -203,6 +203,23 @@ void TFPDTamuPhysics::BuildPhysicalEvent() {
//m_PreTreatedData->Dump();
//cin.get();
}

//separate Left and right detectors
vector<double> PlastRightTime, PlastLeftTime;
mysizeT = m_PreTreatedData->Get_Plast_Time_Mult();
for (UShort_t t = 0; t < mysizeT ; t++) {
//collect info
int side = m_PreTreatedData->Get_Plast_T_DetectorSide(t);
double time = m_PreTreatedData->Get_Plast_Time(t);
// skip values lower than a certain threshold
if (time<0) continue;
//redistribute
if (side==1)
PlastRightTime.push_back(time);
else
PlastLeftTime.push_back(time);
}

/*
//model
// match energy and time together
Expand Down Expand Up @@ -494,7 +511,7 @@ void TFPDTamuPhysics::Clear() {
MicroPositionZ.clear();
MicroCharge.clear();
MicroEnergy.clear();
MicroTime.clear();
MicroTimeOR.clear();
//Avalanche wire
AWireDetNumber.clear();
AWireLeftCharge.clear();
Expand All @@ -504,11 +521,11 @@ void TFPDTamuPhysics::Clear() {
//Plastic scintillator
PlastLeftCharge.clear();
PlastRightCharge.clear();
PlastTimeLeft.clear();
PlastTimeRight.clear();
PlastCharge.clear();
PlastPositionX.clear();
PlastPositionZ.clear();
PlastTime.clear();

//Calculated
PlastPositionX_AW = -99 ; //from AWire and Plastic Z
IonDirection.SetXYZ(0,0,0); // from AWire
Expand Down Expand Up @@ -1138,6 +1155,8 @@ void TFPDTamuPhysics::InitializeRootInputPhysics() {
//Plastic scintillator
inputChain->SetBranchStatus( "PlastLeftCharge" , true );
inputChain->SetBranchStatus( "PlastRightCharge" , true );
inputChain->SetBranchStatus( "PlastLeftTime" , true );
inputChain->SetBranchStatus( "PlastRightTime" , true );
inputChain->SetBranchStatus( "PlastCharge" , true );
inputChain->SetBranchStatus( "PlastPositionX" , true );
inputChain->SetBranchStatus( "PlastPositionZ" , true );
Expand Down
5 changes: 3 additions & 2 deletions NPLib/Detectors/FPDTamu/TFPDTamuPhysics.h
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ class TFPDTamuPhysics : public TObject, public NPL::VDetector {
vector<double> MicroPositionZ;
vector<double> MicroCharge;
vector<double> MicroEnergy;
vector<double> MicroTime;
vector<double> MicroTimeOR;
//Avalanche wire
vector<int> AWireDetNumber;
vector<double> AWireLeftCharge;
Expand All @@ -87,10 +87,11 @@ class TFPDTamuPhysics : public TObject, public NPL::VDetector {
//Plastic scintillator
vector<double> PlastLeftCharge;
vector<double> PlastRightCharge;
vector<double> PlastTimeLeft;
vector<double> PlastTimeRight;
vector<double> PlastCharge;
vector<double> PlastPositionX;
vector<double> PlastPositionZ;
vector<double> PlastTime;

//Calculated AWire and Plastic
double PlastPositionX_AW;
Expand Down
11 changes: 11 additions & 0 deletions NPLib/Detectors/GeTAMU/TGeTAMUPhysics.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -97,6 +97,11 @@ void TGeTAMUPhysics::BuildPhysicalEvent(){
AddBack_Crystal.push_back(clv_crystal[clv]);
AddBack_Segment.push_back(clv_segment[clv]);
}

//Fill the time OR
for (unsigned i = 0 ; i < m_PreTreatedData->GetMultiplicityCoreT(); i++)
GeTimeOR.push_back(m_PreTreatedData->GetCoreTime(i));

}

/////////////////////////////////////////////////
Expand All @@ -108,6 +113,7 @@ void TGeTAMUPhysics::PreTreat(){
double Eraw,Energy;
double Traw,Time;
int clover, crystal, segment;

for(unsigned int i = 0 ; i < mysizeE ; i++){
Eraw = m_EventData->GetCoreEnergy(i);
if(Eraw>0){
Expand All @@ -118,6 +124,7 @@ void TGeTAMUPhysics::PreTreat(){
m_PreTreatedData->SetCoreE(clover,crystal,Energy);
}
}

for(unsigned int i = 0 ; i < mysizeT ; i++){
Traw = m_EventData->GetCoreTime(i);
if(Traw>0){
Expand All @@ -140,6 +147,7 @@ void TGeTAMUPhysics::PreTreat(){
m_PreTreatedData->SetSegmentE(clover,crystal,Energy);
}
}

mysizeT = m_EventData->GetMultiplicitySegmentT();
for(unsigned int i = 0 ; i < mysizeT ; i++){
Traw = m_EventData->GetSegmentTime(i);
Expand All @@ -151,6 +159,7 @@ void TGeTAMUPhysics::PreTreat(){
m_PreTreatedData->SetSegmentT(clover,crystal,Time);
}
}

}

/////////////////////////////////////////////////
Expand Down Expand Up @@ -374,6 +383,8 @@ void TGeTAMUPhysics::Clear() {
AddBack_Clover.clear();
AddBack_Crystal.clear();
AddBack_Segment.clear();
AddBack_T.clear();
GeTimeOR.clear();
}
///////////////////////////////////////////////////////////////////////////
void TGeTAMUPhysics::ClearEventData() {
Expand Down
1 change: 1 addition & 0 deletions NPLib/Detectors/GeTAMU/TGeTAMUPhysics.h
Original file line number Diff line number Diff line change
Expand Up @@ -95,6 +95,7 @@ class TGeTAMUPhysics : public TObject, public NPL::VDetector{
vector<int> AddBack_Clover;
vector<int> AddBack_Crystal;
vector<int> AddBack_Segment;
vector<double> GeTimeOR; // OR of all time signals, can be used for array or or clover only

private: // use for anlysis

Expand Down

0 comments on commit b83e569

Please sign in to comment.