Skip to content
Snippets Groups Projects
Commit 2f35014b authored by deserevi's avatar deserevi
Browse files

* Add support for DummyShape and Square Shape in NPAnalysis

parent 3561f38a
No related branches found
No related tags found
Loading
No preview for this file type
This diff is collapsed.
...@@ -40,11 +40,7 @@ int main(int argc,char** argv) ...@@ -40,11 +40,7 @@ int main(int argc,char** argv)
{ {
// A Usefull Random Generator // A Usefull Random Generator
TRandom rand; TRandom rand;
/*
gROOT->Reset();
gStyle->SetOptStat(1);
gStyle->SetPalette(1);
*/
// Get arguments from command line // Get arguments from command line
if (argc != 4) { if (argc != 4) {
cout << cout <<
...@@ -75,20 +71,19 @@ int main(int argc,char** argv) ...@@ -75,20 +71,19 @@ int main(int argc,char** argv)
/////////////////////// Load ROOT file /////////////////////////////// /////////////////////// Load ROOT file ///////////////////////////////
////////////////////////////////////////////////////////////////////// //////////////////////////////////////////////////////////////////////
// Open output ROOT file from NPTool simulation run // Open output ROOT file from NPTool simulation run
/* string path = getenv("NPTOOL"); string path = getenv("NPTOOL");
path += "/Outputs/"; path += "/Outputs/Simulation/" + rootfileName;
if (!rootfileName.Contains("root")) inFileName += ".root"; TFile *inFile = new TFile(path.c_str());
TFile *inFile = new TFile(path + inFileName); TTree *tree = (TTree*) inFile->Get("SimulatedTree");
TTree *tree = (TTree*) inFile->Get("EventTree");
*/ // TChain* t1 = new TChain("SimulatedTree");
TChain* t1 = new TChain("SimulatedTree"); // t1->Add("../../Outputs/Simulation/mySimul.root");
t1->Add("../../Outputs/Simulation/mySimul.root");
TGaspardTrackerData* EventGPD = new TGaspardTrackerData(); TGaspardTrackerData* EventGPD = new TGaspardTrackerData();
t1->SetBranchAddress("GASPARD",&EventGPD); tree->SetBranchAddress("GASPARD",&EventGPD);
TInteractionCoordinates* InterCoord = new TInteractionCoordinates(); TInteractionCoordinates* InterCoord = new TInteractionCoordinates();
t1->SetBranchAddress("InteractionCoordinates",&InterCoord); tree->SetBranchAddress("InteractionCoordinates",&InterCoord);
TInitialConditions* InitCond = new TInitialConditions(); TInitialConditions* InitCond = new TInitialConditions();
t1->SetBranchAddress("InitialConditions",&InitCond); tree->SetBranchAddress("InitialConditions",&InitCond);
////////////////////////////////////////////////////////////////////// //////////////////////////////////////////////////////////////////////
/////////////////////// Load ROOT file /////////////////////////////// /////////////////////// Load ROOT file ///////////////////////////////
...@@ -100,12 +95,12 @@ int main(int argc,char** argv) ...@@ -100,12 +95,12 @@ int main(int argc,char** argv)
} }
//////////////// Analyse Part //////////////////////////////////////// //////////////// Analyse Part ////////////////////////////////////////
Int_t nentries = (Int_t) t1->GetEntries(); Int_t nentries = (Int_t) tree->GetEntries();
cout << "There are " << nentries << " entries to process" << endl; cout << "There are " << nentries << " entries to process" << endl;
for (Int_t e = 0; e < nentries; e++) { for (Int_t e = 0; e < nentries; e++) {
check_light =false ; check_light =false ;
if ((e+1)%10000==0) cout << "Entries number " << e+1 << " on " << t1->GetEntries() << endl ; if ((e+1)%10000==0) cout << "Entries number " << e+1 << " on " << tree->GetEntries() << endl ;
t1->GetEntry(e); tree->GetEntry(e);
// first check that there is an event detected // first check that there is an event detected
if (EventGPD->GetGPDTrkFirstStageFrontEMult() > 0) { if (EventGPD->GetGPDTrkFirstStageFrontEMult() > 0) {
...@@ -122,7 +117,7 @@ int main(int argc,char** argv) ...@@ -122,7 +117,7 @@ int main(int argc,char** argv)
Int_t detecXT = EventGPD->GetGPDTrkFirstStageFrontTDetectorNbr(0) / det_ref; Int_t detecXT = EventGPD->GetGPDTrkFirstStageFrontTDetectorNbr(0) / det_ref;
Int_t detecYE = EventGPD->GetGPDTrkFirstStageBackEDetectorNbr(0) / det_ref; Int_t detecYE = EventGPD->GetGPDTrkFirstStageBackEDetectorNbr(0) / det_ref;
Int_t detecYT = EventGPD->GetGPDTrkFirstStageBackTDetectorNbr(0) / det_ref; Int_t detecYT = EventGPD->GetGPDTrkFirstStageBackTDetectorNbr(0) / det_ref;
det_ref -= 1000; // for TGaspardTrackerDummyShape // det_ref -= 1000; // for TGaspardTrackerDummyShape
// case of same detector // case of same detector
if (detecXE*detecXT*detecYE*detecYT == 1) { if (detecXE*detecXT*detecYE*detecYT == 1) {
// calculate strip number // calculate strip number
......
This diff is collapsed.
...@@ -9,7 +9,7 @@ ...@@ -9,7 +9,7 @@
* Original Author: N. de Sereville contact address: deserevi@ipno.in2p3.fr * * Original Author: N. de Sereville contact address: deserevi@ipno.in2p3.fr *
* * * *
* Creation Date : 31/08/09 * * Creation Date : 31/08/09 *
* Last update : * * Last update : 10/09/09 *
*---------------------------------------------------------------------------* *---------------------------------------------------------------------------*
* Decription: This class is mainly an interface to the * * Decription: This class is mainly an interface to the *
* TGaspardTrackerPhysics class and it deals with the geometrical* * TGaspardTrackerPhysics class and it deals with the geometrical*
...@@ -17,6 +17,8 @@ ...@@ -17,6 +17,8 @@
* (X, Y, Z) of interaction. * * (X, Y, Z) of interaction. *
*---------------------------------------------------------------------------* *---------------------------------------------------------------------------*
* Comment: * * Comment: *
* + 10/09/09: Add support for Square and DummyShape shapes *
* (N. de Sereville) *
* * * *
* * * *
*****************************************************************************/ *****************************************************************************/
...@@ -32,88 +34,108 @@ ...@@ -32,88 +34,108 @@
#include "TVector3.h" #include "TVector3.h"
class GaspardTracker : public NPA::VDetector class GaspardTracker : public NPA::VDetector
{ {
public: // Default Constructor public:
GaspardTracker() ; GaspardTracker();
~GaspardTracker() ; ~GaspardTracker();
public:
/////////////////////////////////////
// Innherited from VDetector Class //
/////////////////////////////////////
// Read stream at ConfigFile to pick-up parameters of detector (Position,...) using Token
void ReadConfiguration(string);
// Read stream at CalibFile and pick-up calibration parameter using Token
// If argument is "Simulation" no change calibration is loaded
void ReadCalibrationFile(string);
// Activated associated Branches and link it to the private member DetectorData address
// In this method mother Branches (Detector) AND daughter leaf (fDetector_parameter) have to be activated
void InitializeRootInput();
// Create associated branches and associated private member DetectorPhysics address
void InitializeRootOutput();
// This method is called at each event read from the Input Tree.
// The aim is to build treat Raw dat in order to extract physical parameter.
void BuildPhysicalEvent();
public: // Innherited from VDetector Class // Same as above, but only the simplest event and/or simple method are used (low multiplicity, faster algorythm but less efficient ...).
// This method aimed to be used for analysis performed during experiment, when speed is requiered.
// Read stream at ConfigFile to pick-up parameters of detector (Position,...) using Token // NB: This method can eventually be the same as BuildPhysicalEvent.
void ReadConfiguration(string) ; void BuildSimplePhysicalEvent();
// Those two method all to clear the Event Physics or Data
// Read stream at CalibFile and pick-up calibration parameter using Token void ClearEventPhysics() {m_EventPhysics->Clear();}
// If argument is "Simulation" no change calibration is loaded void ClearEventData() {m_EventData->Clear();}
void ReadCalibrationFile(string) ;
public:
// Activated associated Branches and link it to the private member DetectorData address ////////////////////////////////
// In this method mother Branches (Detector) AND daughter leaf (fDetector_parameter) have to be activated // Specific to GaspardTracker //
void InitializeRootInput() ; ////////////////////////////////
// Case of a Square module
// Add a Module using Corner Coordinate information
// Create associated branches and associated private member DetectorPhysics address void AddModuleSquare(TVector3 C_X1_Y1,
void InitializeRootOutput() ; TVector3 C_X128_Y1,
TVector3 C_X1_Y128,
TVector3 C_X128_Y128);
// This method is called at each event read from the Input Tree. Aime is to build treat Raw dat in order to extract physical parameter.
void BuildPhysicalEvent() ; // Add a Module using R Theta Phi of Si center information
void AddModuleSquare(double theta,
double phi,
// Same as above, but only the simplest event and/or simple method are used (low multiplicity, faster algorythm but less efficient ...). double distance,
// This method aimed to be used for analysis performed during experiment, when speed is requiered. double beta_u,
// NB: This method can eventually be the same as BuildPhysicalEvent. double beta_v,
void BuildSimplePhysicalEvent() ; double beta_w);
// Those two method all to clear the Event Physics or Data // Case of a DummyShape module
void ClearEventPhysics() {EventPhysics->Clear();} // Add a Module using Corner Coordinate information
void ClearEventData() {EventData->Clear();} void AddModuleDummyShape(TVector3 C_X1_Y1,
TVector3 C_X128_Y1,
TVector3 C_X1_Y128,
public: // Specific to GaspardTracker TVector3 C_X128_Y128);
// Add a Telescope using Corner Coordinate information
void AddTelescope( TVector3 C_X1_Y1 , // Add a Module using R Theta Phi of Si center information
TVector3 C_X128_Y1 , void AddModuleDummyShape(double theta,
TVector3 C_X1_Y128 , double phi,
TVector3 C_X128_Y128 ); double distance,
double beta_u,
// Add a Telescope using R Theta Phi of Si center information double beta_v,
void AddTelescope( double theta , double beta_w);
double phi ,
double distance , // Getters to retrieve the (X,Y,Z) coordinates of a pixel defined by strips (X,Y)
double beta_u , double GetStripPositionX(int N ,int X ,int Y) { return m_StripPositionX[N-1][X-1][Y-1]; };
double beta_v , double GetStripPositionY(int N ,int X ,int Y) { return m_StripPositionY[N-1][X-1][Y-1]; };
double beta_w ); double GetStripPositionZ(int N ,int X ,int Y) { return m_StripPositionZ[N-1][X-1][Y-1]; };
double GetNumberOfModule() { return m_NumberOfModule; };
double GetStripPositionX( int N , int X , int Y ) { return StripPositionX[N-1][X-1][Y-1] ; };
double GetStripPositionY( int N , int X , int Y ) { return StripPositionY[N-1][X-1][Y-1] ; }; // Get Root input and output objects
double GetStripPositionZ( int N , int X , int Y ) { return StripPositionZ[N-1][X-1][Y-1] ; }; TGaspardTrackerData* GetEventData() {return m_EventData;};
TGaspardTrackerPhysics* GetEventPhysics() {return m_EventPhysics;};
double GetNumberOfTelescope() { return NumberOfTelescope ; } ;
// To be called after a build Physical Event
// To be called after a build Physical Event double GetEnergyDeposit();
TVector3 GetPositionOfInteraction();
double GetEnergyDeposit() ;
void Print();
TVector3 GetPositionOfInteraction();
void Print() ; private:
////////////////////////////////////////
private: // Root Input and Output tree classes // Root Input and Output tree classes //
////////////////////////////////////////
TGaspardTrackerData* EventData ; TGaspardTrackerData* m_EventData;
TGaspardTrackerPhysics* EventPhysics ; TGaspardTrackerPhysics* m_EventPhysics;
private: // Spatial Position of Strip Calculated on bases of detector position private:
// Spatial Position of Strip Calculated on basis of detector position
int NumberOfTelescope ; int m_NumberOfModule;
vector< vector < vector < double > > > m_StripPositionX;
vector< vector < vector < double > > > StripPositionX ; vector< vector < vector < double > > > m_StripPositionY;
vector< vector < vector < double > > > StripPositionY ; vector< vector < vector < double > > > m_StripPositionZ;
vector< vector < vector < double > > > StripPositionZ ; };
};
#endif #endif
...@@ -24,111 +24,137 @@ ...@@ -24,111 +24,137 @@
#include "TGaspardTrackerPhysics.h" #include "TGaspardTrackerPhysics.h"
#include <iostream> #include <iostream>
ClassImp(TGaspardTrackerPhysics) ClassImp(TGaspardTrackerPhysics)
TGaspardTrackerPhysics::TGaspardTrackerPhysics() TGaspardTrackerPhysics::TGaspardTrackerPhysics()
{ EventMultiplicity = 0 ;} {
EventMultiplicity = 0;
}
TGaspardTrackerPhysics::~TGaspardTrackerPhysics()
{
Clear();
}
TGaspardTrackerPhysics::~TGaspardTrackerPhysics() {Clear();}
void TGaspardTrackerPhysics::BuildSimplePhysicalEvent(TGaspardTrackerData* Data) void TGaspardTrackerPhysics::BuildSimplePhysicalEvent(TGaspardTrackerData* Data)
{ {
BuildPhysicalEvent(Data); BuildPhysicalEvent(Data);
} }
void TGaspardTrackerPhysics::BuildPhysicalEvent(TGaspardTrackerData* Data) void TGaspardTrackerPhysics::BuildPhysicalEvent(TGaspardTrackerData* Data)
{ {
/* // Check // Check
bool Check_Si = false ;bool Check_SiLi = false ; bool Check_CsI = false ; bool Check_FirstStage = false ;bool Check_SecondStage = false ; bool Check_ThirdStage = false ;
// Threshold
double Si_X_E_Threshold = 0 ; double Si_X_T_Threshold = 0 ;
double Si_Y_E_Threshold = 0 ; double Si_Y_T_Threshold = 0 ;
double SiLi_E_Threshold = 0 ; double SiLi_T_Threshold = 0 ;
double CsI_E_Threshold = 0 ; double CsI_T_Threshold = 0 ;
// Multiplicity 1
if( Data->GetMMStripXEMult()==1 && Data->GetMMStripYEMult()==1 && Data->GetMMStripXTMult()==1 && Data->GetMMStripXTMult()==1 )
{
if( //Same detector
Data->GetMMStripXEDetectorNbr(0) == Data->GetMMStripXTDetectorNbr(0)
&& Data->GetMMStripXTDetectorNbr(0) == Data->GetMMStripYTDetectorNbr(0)
&& Data->GetMMStripYTDetectorNbr(0) == Data->GetMMStripYEDetectorNbr(0)
// Same strip
&& Data->GetMMStripXEStripNbr(0) == Data->GetMMStripXTStripNbr(0)
&& Data->GetMMStripYEStripNbr(0) == Data->GetMMStripYTStripNbr(0) )
{
TelescopeNumber.push_back(Data->GetMMStripXEDetectorNbr(0)) ;
// Data->Get Max Energy
if(Data->GetMMStripXEEnergy(0) > Data->GetMMStripYEEnergy(0)) Si_E.push_back( Data->GetMMStripXEEnergy(0) ) ;
else Si_E.push_back( Data->GetMMStripYEEnergy(0) ) ;
// Data->Get Min Time
if(Data->GetMMStripXTTime(0) < Data->GetMMStripYTTime(0)) Si_T.push_back( Data->GetMMStripXTTime(0) ) ;
else Si_T.push_back( Data->GetMMStripYTTime(0) ) ;
Si_X.push_back( Data->GetMMStripXEStripNbr(0) ) ;
Si_Y.push_back( Data->GetMMStripYEStripNbr(0) ) ;
Check_Si = true ;
EventMultiplicity = 1;
}
// FIXME we have to resolve case where SiLi/CsI mult > Si mult by looking time? and Si XY vs Pad/crystal Nbr
if (Check_Si)
{
// Si(Li)
for (int i = 0 ; i < Data->GetMMSiLiEMult() ; i++)
{
if ( Data->GetMMSiLiEDetectorNbr(i) == Data->GetMMStripXEDetectorNbr(0)
&& Data->GetMMSiLiEEnergy(i) > SiLi_E_Threshold )
{
SiLi_E.push_back(Data->GetMMSiLiEEnergy(i)) ;
SiLi_N.push_back(Data->GetMMSiLiEPadNbr(i)) ;
if ( Data->GetMMSiLiTDetectorNbr(i) == Data->GetMMStripXEDetectorNbr(0) )
{
SiLi_T.push_back(Data->GetMMSiLiTTime(i)) ;
Check_SiLi = true ;
}
}
}
// CsI
for (int i = 0 ; i < Data->GetMMCsIEMult() ; i++)
{
if ( Data->GetMMCsIEDetectorNbr(i) == Data->GetMMStripXEDetectorNbr(0)
&& Data->GetMMCsIEEnergy(i) > CsI_E_Threshold )
{
CsI_E.push_back(Data->GetMMCsIEEnergy(i)) ;
CsI_N.push_back(Data->GetMMCsIECristalNbr(i)) ;
if ( Data->GetMMCsITDetectorNbr(i) == Data->GetMMStripXEDetectorNbr(0) )
{
CsI_T.push_back(Data->GetMMCsITTime(i)) ;
Check_CsI = true ;
}
}
}
if (!Check_SiLi && !Check_CsI ) TotalEnergy.push_back( Si_E.at(0) );
else if (Check_SiLi && !Check_CsI ) TotalEnergy.push_back( + Si_E.at(0) + SiLi_E.at(0) );
else if (Check_CsI && !Check_SiLi) TotalEnergy.push_back( CsI_E .at(0) + Si_E.at(0) );
else if (Check_CsI && Check_SiLi) TotalEnergy.push_back( CsI_E .at(0) + Si_E.at(0) + SiLi_E.at(0) );
return;
}
//FIXME: should built a pseudo event and then Check if particle could be identified with EDE method // Thresholds
// Dump double FirstStage_Front_E_Threshold = 0; double FirstStage_Front_T_Threshold = 0;
} double FirstStage_Back_E_Threshold = 0; double FirstStage_Back_T_Threshold = 0;
double SecondStage_E_Threshold = 0; double SecondStage_T_Threshold = 0;
double ThirdStage_E_Threshold = 0; double ThirdStage_T_Threshold = 0;
// calculate multipicity in the first stage
int multXE = Data->GetGPDTrkFirstStageFrontEMult();
int multYE = Data->GetGPDTrkFirstStageBackEMult();
int multXT = Data->GetGPDTrkFirstStageFrontTMult();
int multYT = Data->GetGPDTrkFirstStageBackTMult();
// calculate multiplicity of 2nd and third stages
int mult2E = Data->GetGPDTrkSecondStageEMult();
int mult2T = Data->GetGPDTrkSecondStageTMult();
int mult3E = Data->GetGPDTrkThirdStageEMult();
int mult3T = Data->GetGPDTrkThirdStageTMult();
// Deal with multiplicity 1 for the first layer
if (multXE==1 && multYE==1 && multXT==1 && multYT==1) {
// calculate detector number
int det_ref = Data->GetGPDTrkFirstStageFrontEDetectorNbr(0);
int detecXE = Data->GetGPDTrkFirstStageFrontEDetectorNbr(0) / det_ref;
int detecXT = Data->GetGPDTrkFirstStageFrontTDetectorNbr(0) / det_ref;
int detecYE = Data->GetGPDTrkFirstStageBackEDetectorNbr(0) / det_ref;
int detecYT = Data->GetGPDTrkFirstStageBackTDetectorNbr(0) / det_ref;
// case of same detector
if (detecXE*detecXT*detecYE*detecYT == 1) {
// store module number
ModuleNumber.push_back(det_ref);
// calculate strip number
int stripXE = Data->GetGPDTrkFirstStageFrontEStripNbr(0);
int stripXT = Data->GetGPDTrkFirstStageFrontTStripNbr(0);
int stripYE = Data->GetGPDTrkFirstStageBackEStripNbr(0);
int stripYT = Data->GetGPDTrkFirstStageBackTStripNbr(0);
// case of same strips on X and Y
if (stripXE == stripXT && stripYE == stripYT) { // here we have a good strip event
// various
Check_FirstStage = true;
EventMultiplicity = 1;
// store strip ID
FirstStage_X.push_back(stripXE);
FirstStage_Y.push_back(stripYE);
// get energy from strips and store it
double EnergyStripFront = Data->GetGPDTrkFirstStageFrontEEnergy(0);
double EnergyStripBack = Data->GetGPDTrkFirstStageBackEEnergy(0);
double EnergyStrip = 0.5 * (EnergyStripFront + EnergyStripBack);
// double EnergyStrip = EnergyStripFront;
// if (EnergyStripBack > EnergyStrip) EnergyStrip = EnergyStripBack;
FirstStage_E.push_back(EnergyStrip);
double EnergyTot = EnergyStrip;
// get time from strips and store it
double TimeStripFront = Data->GetGPDTrkFirstStageFrontEEnergy(0);
double TimeStripBack = Data->GetGPDTrkFirstStageBackEEnergy(0);
double TimeStrip = 0.5 * (EnergyStripFront + EnergyStripBack);
// double TimeStrip = EnergyStripFront;
// if (TimeStripBack > TimeStrip) TimeStrip = TimeStripBack;
FirstStage_T.push_back(TimeStrip);
// check if we have a 2nd stage event
if (mult2E==1 && mult2T==1) {
Check_SecondStage = true;
double EnergySecond = Data->GetGPDTrkSecondStageEEnergy(0);
SecondStage_E.push_back(EnergySecond);
EnergyTot += EnergySecond;
}
else if (mult2E>1 || mult2T>1) {
cout << "Warning: multiplicity in second stage greater than in firststage" << endl;
}
// check if we have a third stage event
if (mult3E==1 && mult3T==1) {
Check_ThirdStage = true;
double EnergyThird = Data->GetGPDTrkThirdStageEEnergy(0);
ThirdStage_E.push_back(EnergyThird);
EnergyTot += EnergyThird;
}
else if (mult3E>1 || mult3T>1) {
cout << "Warning: multiplicity in third stage greater than in firststage" << endl;
}
// Analysis code here.
TotalEnergy.push_back(EnergyTot);
}
else {
cout << "Not same strips" << endl;
}
}
else {
cout << "Not same detector" << endl;
}
}
else {
/* cout << "Multiplicity is not one, it is: " << endl;
cout << "\tmultXE: " << multXE << endl;
cout << "\tmultXT: " << multXT << endl;
cout << "\tmultYE: " << multYE << endl;
cout << "\tmultYT: " << multYT << endl;*/
}
/*
// Multiplicity 2 // Multiplicity 2
if( Data->GetMMStripXEMult()==2 && Data->GetMMStripYEMult()==2 && Data->GetMMStripXTMult()==2 && Data->GetMMStripXTMult()==2 ) if( Data->GetMMStripXEMult()==2 && Data->GetMMStripYEMult()==2 && Data->GetMMStripXTMult()==2 && Data->GetMMStripXTMult()==2 )
{ {
...@@ -141,12 +167,12 @@ void TGaspardTrackerPhysics::BuildPhysicalEvent(TGaspardTrackerData* Data) ...@@ -141,12 +167,12 @@ void TGaspardTrackerPhysics::BuildPhysicalEvent(TGaspardTrackerData* Data)
// loop on both event // loop on both event
for (int jj = 0 ; jj < 2 ; jj++) for (int jj = 0 ; jj < 2 ; jj++)
{ {
Check_Si = false ;Check_SiLi = false ;Check_CsI = false ; Check_FirstStage = false ;Check_SecondStage = false ;Check_ThirdStage = false ;
TelescopeNumber.push_back( Data->GetMMStripXEDetectorNbr(jj) ) ; ModuleNumber.push_back( Data->GetMMStripXEDetectorNbr(jj) ) ;
EX = Data->GetMMStripXEEnergy(jj) ; EX = Data->GetMMStripXEEnergy(jj) ;
Si_X.push_back( Data->GetMMStripXEStripNbr(jj)) ; FirstStage_X.push_back( Data->GetMMStripXEStripNbr(jj)) ;
// Get Corresponding time // Get Corresponding time
for(int i = 0 ; i < 2 ; i++) for(int i = 0 ; i < 2 ; i++)
...@@ -161,45 +187,45 @@ void TGaspardTrackerPhysics::BuildPhysicalEvent(TGaspardTrackerData* Data) ...@@ -161,45 +187,45 @@ void TGaspardTrackerPhysics::BuildPhysicalEvent(TGaspardTrackerData* Data)
{ {
if( Data->GetMMStripYEDetectorNbr(i) == Data->GetMMStripXEDetectorNbr(jj) ) if( Data->GetMMStripYEDetectorNbr(i) == Data->GetMMStripXEDetectorNbr(jj) )
{ {
Si_Y.push_back( Data->GetMMStripYEStripNbr(i)) ; FirstStage_Y.push_back( Data->GetMMStripYEStripNbr(i)) ;
EY = Data->GetMMStripXEEnergy(i) ; EY = Data->GetMMStripXEEnergy(i) ;
TY = Data->GetMMStripXTTime(i) ; TY = Data->GetMMStripXTTime(i) ;
// if (EX>EY) Si_E.push_back(EX) ; // if (EX>EY) FirstStage_E.push_back(EX) ;
// else Si_E.push_back(EY) ; // else FirstStage_E.push_back(EY) ;
Si_E.push_back(EX); FirstStage_E.push_back(EX);
if (TX>TY) Si_T.push_back(TY) ; if (TX>TY) FirstStage_T.push_back(TY) ;
else Si_T.push_back(TX) ; else FirstStage_T.push_back(TX) ;
Check_Si = true ; Check_FirstStage = true ;
} }
} }
if (Check_Si) if (Check_FirstStage)
{ {
// Si(Li) // Si(Li)
for (int i = 0 ; i < Data->GetMMSiLiEMult() ; i++) for (int i = 0 ; i < Data->GetMMSiLiEMult() ; i++)
{ {
if ( Data->GetMMSiLiEDetectorNbr(i) == Data->GetMMStripXEDetectorNbr(jj) if ( Data->GetMMSiLiEDetectorNbr(i) == Data->GetMMStripXEDetectorNbr(jj)
&& Data->GetMMSiLiEEnergy(i) > SiLi_E_Threshold ) && Data->GetMMSiLiEEnergy(i) > SecondStage_E_Threshold )
{ {
SiLi_E.push_back(Data->GetMMSiLiEEnergy(i)) ; SecondStage_E.push_back(Data->GetMMSiLiEEnergy(i)) ;
SiLi_N.push_back(Data->GetMMSiLiEPadNbr(i)) ; SecondStage_N.push_back(Data->GetMMSiLiEPadNbr(i)) ;
if ( Data->GetMMSiLiTDetectorNbr(i) == Data->GetMMStripXEDetectorNbr(jj) if ( Data->GetMMSiLiTDetectorNbr(i) == Data->GetMMStripXEDetectorNbr(jj)
&& Data->GetMMSiLiTPadNbr(i) == Data->GetMMSiLiEPadNbr(i) ) && Data->GetMMSiLiTPadNbr(i) == Data->GetMMSiLiEPadNbr(i) )
{ {
SiLi_T.push_back(Data->GetMMSiLiTTime(i)) ; SecondStage_T.push_back(Data->GetMMSiLiTTime(i)) ;
Check_SiLi = true ; Check_SecondStage = true ;
} }
} }
else else
{ {
SiLi_E.push_back(-1) ; SecondStage_E.push_back(-1) ;
SiLi_T.push_back(-1) ; SecondStage_T.push_back(-1) ;
SiLi_N.push_back(-1) ; SecondStage_N.push_back(-1) ;
} }
} }
...@@ -207,29 +233,29 @@ void TGaspardTrackerPhysics::BuildPhysicalEvent(TGaspardTrackerData* Data) ...@@ -207,29 +233,29 @@ void TGaspardTrackerPhysics::BuildPhysicalEvent(TGaspardTrackerData* Data)
for (int i = 0 ; i < Data->GetMMCsIEMult() ; i++) for (int i = 0 ; i < Data->GetMMCsIEMult() ; i++)
{ {
if ( Data->GetMMCsIEDetectorNbr(i) == Data->GetMMStripXEDetectorNbr(jj) if ( Data->GetMMCsIEDetectorNbr(i) == Data->GetMMStripXEDetectorNbr(jj)
&& Data->GetMMCsIEEnergy(i) > CsI_E_Threshold ) && Data->GetMMCsIEEnergy(i) > ThirdStage_E_Threshold )
{ {
CsI_E.push_back(Data->GetMMCsIEEnergy(i)) ; ThirdStage_E.push_back(Data->GetMMCsIEEnergy(i)) ;
CsI_N.push_back(Data->GetMMCsIECristalNbr(i)) ; ThirdStage_N.push_back(Data->GetMMCsIECristalNbr(i)) ;
if ( Data->GetMMCsITDetectorNbr(i) == Data->GetMMStripXEDetectorNbr(jj) if ( Data->GetMMCsITDetectorNbr(i) == Data->GetMMStripXEDetectorNbr(jj)
&& Data->GetMMCsITCristalNbr(i) == Data->GetMMCsIECristalNbr(i) ) && Data->GetMMCsITCristalNbr(i) == Data->GetMMCsIECristalNbr(i) )
{ {
CsI_T.push_back(Data->GetMMCsITTime(i)) ; ThirdStage_T.push_back(Data->GetMMCsITTime(i)) ;
Check_CsI = true ; Check_ThirdStage = true ;
} }
} }
else else
{ {
CsI_E.push_back(-1) ; ThirdStage_E.push_back(-1) ;
CsI_T.push_back(-1) ; ThirdStage_T.push_back(-1) ;
CsI_N.push_back(-1) ; ThirdStage_N.push_back(-1) ;
} }
} }
TotalEnergy.push_back(Si_E.at(jj)) ; TotalEnergy.push_back(FirstStage_E.at(jj)) ;
if (Check_SiLi) TotalEnergy.at(jj) += SiLi_E.at(jj) ; if (Check_SecondStage) TotalEnergy.at(jj) += SecondStage_E.at(jj) ;
if (Check_CsI) TotalEnergy.at(jj) += CsI_E.at(jj) ; if (Check_ThirdStage) TotalEnergy.at(jj) += ThirdStage_E.at(jj) ;
} }
} }
return; return;
...@@ -245,30 +271,29 @@ void TGaspardTrackerPhysics::BuildPhysicalEvent(TGaspardTrackerData* Data) ...@@ -245,30 +271,29 @@ void TGaspardTrackerPhysics::BuildPhysicalEvent(TGaspardTrackerData* Data)
} }
} }
*/ */
} }
void TGaspardTrackerPhysics::Clear() void TGaspardTrackerPhysics::Clear()
{ {
EventMultiplicity= 0 ; EventMultiplicity= 0;
TelescopeNumber .clear() ; ModuleNumber.clear();
EventType .clear() ; EventType.clear();
TotalEnergy .clear() ; TotalEnergy.clear();
// Si X // Si X
Si_E.clear() ; FirstStage_E.clear();
Si_T.clear() ; FirstStage_T.clear();
Si_X.clear() ; FirstStage_X.clear();
Si_Y.clear() ; FirstStage_Y.clear();
// Si(Li) // Si(Li)
SiLi_E.clear() ; SecondStage_E.clear();
SiLi_T.clear() ; SecondStage_T.clear();
SiLi_N.clear() ; SecondStage_N.clear();
// CsI
CsI_E.clear() ;
CsI_T.clear() ;
CsI_N.clear() ;
}
// CsI
ThirdStage_E.clear();
ThirdStage_T.clear();
ThirdStage_N.clear();
}
...@@ -32,45 +32,45 @@ using namespace std ; ...@@ -32,45 +32,45 @@ using namespace std ;
class TGaspardTrackerPhysics : public TObject class TGaspardTrackerPhysics : public TObject
{ {
public: public:
TGaspardTrackerPhysics() ; TGaspardTrackerPhysics();
~TGaspardTrackerPhysics(); ~TGaspardTrackerPhysics();
public: public:
void Clear() ; void Clear();
void BuildPhysicalEvent(TGaspardTrackerData* Data) ; void BuildPhysicalEvent(TGaspardTrackerData* Data);
void BuildSimplePhysicalEvent(TGaspardTrackerData* Data) ; void BuildSimplePhysicalEvent(TGaspardTrackerData* Data);
public: public:
// Provide Physical Multiplicity // Provide Physical Multiplicity
Int_t EventMultiplicity ; Int_t EventMultiplicity;
// Provide a Classification of Event // Provide a Classification of Event
vector<int> EventType ; vector<int> EventType;
// Telescope // Telescope
vector<int> TelescopeNumber ; vector<int> ModuleNumber;
// Si X // FirstStage
vector<double> Si_E ; vector<double> FirstStage_E;
vector<double> Si_T ; vector<double> FirstStage_T;
vector<int> Si_X ; vector<int> FirstStage_X;
vector<int> Si_Y ; vector<int> FirstStage_Y;
// Si(Li) // SecondStage
vector<double> SiLi_E ; vector<double> SecondStage_E;
vector<double> SiLi_T ; vector<double> SecondStage_T;
vector<int> SiLi_N ; vector<int> SecondStage_N;
// CsI // ThirdStage
vector<double> CsI_E ; vector<double> ThirdStage_E;
vector<double> CsI_T ; vector<double> ThirdStage_T;
vector<int> CsI_N ; vector<int> ThirdStage_N;
// Physical Value // Physical Value
vector<double> TotalEnergy ; vector<double> TotalEnergy;
ClassDef(TGaspardTrackerPhysics,1) // GaspardTrackerPHysics structure ClassDef(TGaspardTrackerPhysics,1) // GaspardTrackerPHysics structure
}; };
#endif #endif
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