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

* Support for multi-shape based detector (Gaspard) in NPTool

   + A lot of work has been done

   + TGaspardTrackerPhysicsNew class
     This class now *only* hold the physical information as calculated
     from NPAnalysis.

   + Status:
     running NPAnalysis gives the same results with the new structure
     than before in case of the gaspardTestSpheric detector (only one
     shape)

   + Everything is prepared for multi-shape but whould be tested
parent ec62d5ec
No related branches found
No related tags found
No related merge requests found
Showing
with 741 additions and 352 deletions
...@@ -27,7 +27,7 @@ Target ...@@ -27,7 +27,7 @@ Target
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
GaspardTracker GaspardTracker
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%0 Central Barrel %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%0 Central Barrel
GPDTrapezoid %GPDTrapezoid
THETA= 90 THETA= 90
PHI= 90 PHI= 90
R= 300 R= 300
......
...@@ -7,8 +7,7 @@ ...@@ -7,8 +7,7 @@
// NPA // NPA
#include "DetectorManager.h" #include "DetectorManager.h"
//#include "GaspardTracker.h" #include "GaspardTrackerNew.h"
#include "TGaspardTrackerPhysicsNew.h"
// STL C++ // STL C++
#include <iostream> #include <iostream>
......
#include "TGaspardTrackerDummyShape.h" #include "GaspardTrackerDummyShape.h"
// C++ headers // C++ headers
#include <iostream> #include <iostream>
...@@ -6,22 +6,30 @@ ...@@ -6,22 +6,30 @@
#include <string> #include <string>
#include <cmath> #include <cmath>
// Gaspard
#include "TGaspardTrackerPhysicsNew.h"
TGaspardTrackerDummyShape::TGaspardTrackerDummyShape(map<int, TGaspardTrackerModule*> &Module)
GaspardTrackerDummyShape::GaspardTrackerDummyShape(map<int, GaspardTrackerModule*> &Module,
TGaspardTrackerPhysicsNew* &EventPhysics)
: m_ModuleTest(Module), : m_ModuleTest(Module),
m_EventPhysics(EventPhysics),
m_EventData(0),
m_PreTreatData(new TGaspardTrackerData),
m_NumberOfModule(0) m_NumberOfModule(0)
{ {
} }
TGaspardTrackerDummyShape::~TGaspardTrackerDummyShape() GaspardTrackerDummyShape::~GaspardTrackerDummyShape()
{ {
delete m_PreTreatData;
} }
void TGaspardTrackerDummyShape::ReadConfiguration(string Path) void GaspardTrackerDummyShape::ReadConfiguration(string Path)
{ {
ifstream ConfigFile; ifstream ConfigFile;
ConfigFile.open(Path.c_str()); ConfigFile.open(Path.c_str());
...@@ -208,21 +216,134 @@ void TGaspardTrackerDummyShape::ReadConfiguration(string Path) ...@@ -208,21 +216,134 @@ void TGaspardTrackerDummyShape::ReadConfiguration(string Path)
} }
void GaspardTrackerDummyShape::PreTreat()
{
}
void TGaspardTrackerDummyShape::BuildPhysicalEvent() void GaspardTrackerDummyShape::BuildPhysicalEvent()
{ {
// Check flags
bool Check_FirstStage = false;
bool Check_SecondStage = false;
bool Check_ThirdStage = false;
// Thresholds
/*
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 = m_EventData->GetGPDTrkFirstStageFrontEMult();
int multYE = m_EventData->GetGPDTrkFirstStageBackEMult();
int multXT = m_EventData->GetGPDTrkFirstStageFrontTMult();
int multYT = m_EventData->GetGPDTrkFirstStageBackTMult();
// calculate multiplicity of 2nd and third stages
int mult2E = m_EventData->GetGPDTrkSecondStageEMult();
int mult2T = m_EventData->GetGPDTrkSecondStageTMult();
int mult3E = m_EventData->GetGPDTrkThirdStageEMult();
int mult3T = m_EventData->GetGPDTrkThirdStageTMult();
// Deal with multiplicity 1 for the first layer
if (multXE==1 && multYE==1 && multXT==1 && multYT==1) {
// calculate detector number
int det_ref = m_EventData->GetGPDTrkFirstStageFrontEDetectorNbr(0);
int detecXE = m_EventData->GetGPDTrkFirstStageFrontEDetectorNbr(0) / det_ref;
int detecXT = m_EventData->GetGPDTrkFirstStageFrontTDetectorNbr(0) / det_ref;
int detecYE = m_EventData->GetGPDTrkFirstStageBackEDetectorNbr(0) / det_ref;
int detecYT = m_EventData->GetGPDTrkFirstStageBackTDetectorNbr(0) / det_ref;
// module number starting from 0
det_ref -= m_index["DummyShape"];
// case of same detector
if (detecXE*detecXT*detecYE*detecYT == 1) {
// store module number
m_EventPhysics->SetModuleNumber(det_ref + m_index["DummyShape"]);
// calculate strip number
int stripXE = m_EventData->GetGPDTrkFirstStageFrontEStripNbr(0);
int stripXT = m_EventData->GetGPDTrkFirstStageFrontTStripNbr(0);
int stripYE = m_EventData->GetGPDTrkFirstStageBackEStripNbr(0);
int stripYT = m_EventData->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
m_EventPhysics->SetFirstStageFrontPosition(stripXE);
m_EventPhysics->SetFirstStageBackPosition(stripYE);
// get energy from strips and store it
double EnergyStripFront = m_EventData->GetGPDTrkFirstStageFrontEEnergy(0);
// double EnergyStripBack = m_EventData->GetGPDTrkFirstStageBackEEnergy(0);
// double EnergyStrip = 0.5 * (EnergyStripFront + EnergyStripBack);
double EnergyStrip = EnergyStripFront;
// if (EnergyStripBack > EnergyStrip) EnergyStrip = EnergyStripBack;
m_EventPhysics->SetFirstStageEnergy(EnergyStrip);
double EnergyTot = EnergyStrip;
// get time from strips and store it
double TimeStripFront = m_EventData->GetGPDTrkFirstStageFrontEEnergy(0);
double TimeStripBack = m_EventData->GetGPDTrkFirstStageBackEEnergy(0);
double TimeStrip = 0.5 * (TimeStripFront + TimeStripBack);
// double TimeStrip = TimeStripFront;
// if (TimeStripBack > TimeStrip) TimeStrip = TimeStripBack;
m_EventPhysics->SetFirstStageTime(TimeStrip);
// check if we have a 2nd stage event
if (mult2E==1 && mult2T==1) {
Check_SecondStage = true;
double EnergySecond = m_EventData->GetGPDTrkSecondStageEEnergy(0);
m_EventPhysics->SetSecondStageEnergy(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 = m_EventData->GetGPDTrkThirdStageEEnergy(0);
m_EventPhysics->SetThirdStageEnergy(EnergyThird);
EnergyTot += EnergyThird;
}
else if (mult3E>1 || mult3T>1) {
cout << "Warning: multiplicity in third stage greater than in firststage" << endl;
}
// Fill total energy
m_EventPhysics->SetTotalEnergy(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;*/
}
} }
void TGaspardTrackerDummyShape::BuildSimplePhysicalEvent() void GaspardTrackerDummyShape::BuildSimplePhysicalEvent()
{ {
} }
void TGaspardTrackerDummyShape::AddModule(TVector3 C_X1_Y1, void GaspardTrackerDummyShape::AddModule(TVector3 C_X1_Y1,
TVector3 C_X128_Y1, TVector3 C_X128_Y1,
TVector3 C_X1_Y128, TVector3 C_X1_Y128,
TVector3 C_X128_Y128) TVector3 C_X128_Y128)
...@@ -288,7 +409,7 @@ void TGaspardTrackerDummyShape::AddModule(TVector3 C_X1_Y1, ...@@ -288,7 +409,7 @@ void TGaspardTrackerDummyShape::AddModule(TVector3 C_X1_Y1,
void TGaspardTrackerDummyShape::AddModule(double theta, void GaspardTrackerDummyShape::AddModule(double theta,
double phi, double phi,
double distance, double distance,
double beta_u, double beta_u,
......
#ifndef TGaspardTrackerDummyShape_h #ifndef GaspardTrackerDummyShape_h
#define TGaspardTrackerDummyShape_h 1 #define GaspardTrackerDummyShape_h 1
// C++ headers // C++ headers
#include <iostream>
#include <string> #include <string>
#include <map> #include <map>
#include <vector> #include <vector>
// NPTool - ROOT headers // ROOT headers
#include "TInteractionCoordinates.h"
#include "TGaspardTrackerData.h"
#include "TVector3.h" #include "TVector3.h"
// Gaspard headers // Gaspard headers
#include "TGaspardTrackerModule.h" #include "TGaspardTrackerData.h"
#include "TGaspardTrackerPhysicsNew.h"
#include "GaspardTrackerModule.h"
using namespace std; using namespace std;
class TGaspardTrackerDummyShape : public TGaspardTrackerModule class GaspardTrackerDummyShape : public GaspardTrackerModule
{ {
public: public:
//////////////////////////////////////////////////// ////////////////////////////////////////////////////
/////// Default Constructor and Destructor ///////// /////// Default Constructor and Destructor /////////
//////////////////////////////////////////////////// ////////////////////////////////////////////////////
TGaspardTrackerDummyShape(map<int, TGaspardTrackerModule*> &Module); GaspardTrackerDummyShape(map<int, GaspardTrackerModule*> &Module, TGaspardTrackerPhysicsNew* &EventPhysics);
virtual ~TGaspardTrackerDummyShape(); virtual ~GaspardTrackerDummyShape();
public: public:
//////////////////////////////////////////////////// ////////////////////////////////////////////////////
...@@ -42,7 +43,18 @@ public: ...@@ -42,7 +43,18 @@ public:
void BuildSimplePhysicalEvent(); void BuildSimplePhysicalEvent();
private: private:
map<int, TGaspardTrackerModule*> &m_ModuleTest; map<int, GaspardTrackerModule*> &m_ModuleTest;
TGaspardTrackerPhysicsNew* &m_EventPhysics;
public:
void SetGaspardDataPointer(TGaspardTrackerData* gaspardData) {m_EventData = gaspardData;};
void PreTreat();
private:
// Gaspard data coming from TGaspardTrackerPhysics through the
// SetGaspardDataPointer method
TGaspardTrackerData* m_EventData;
TGaspardTrackerData* m_PreTreatData;
public: public:
//////////////////////////////// ////////////////////////////////
...@@ -63,9 +75,9 @@ public: ...@@ -63,9 +75,9 @@ public:
double beta_w); double beta_w);
// Getters to retrieve the (X,Y,Z) coordinates of a pixel defined by strips (X,Y) // Getters to retrieve the (X,Y,Z) coordinates of a pixel defined by strips (X,Y)
double GetStripPositionX(int N ,int X ,int Y) { return m_StripPositionX[N-1][X-1][Y-1]; } double GetStripPositionX(int N ,int X ,int Y) { return m_StripPositionX[N-1-m_index["DummyShape"]][X-1][Y-1]; }
double GetStripPositionY(int N ,int X ,int Y) { return m_StripPositionY[N-1][X-1][Y-1]; } double GetStripPositionY(int N ,int X ,int Y) { return m_StripPositionY[N-1-m_index["DummyShape"]][X-1][Y-1]; }
double GetStripPositionZ(int N ,int X ,int Y) { return m_StripPositionZ[N-1][X-1][Y-1]; } double GetStripPositionZ(int N ,int X ,int Y) { return m_StripPositionZ[N-1-m_index["DummyShape"]][X-1][Y-1]; }
double GetNumberOfModule() { return m_NumberOfModule; } double GetNumberOfModule() { return m_NumberOfModule; }
private: private:
......
#include "TGaspardTrackerModule.h" #include "GaspardTrackerModule.h"
TGaspardTrackerModule::TGaspardTrackerModule() GaspardTrackerModule::GaspardTrackerModule()
{ {
InitializeIndex(); InitializeIndex();
} }
TGaspardTrackerModule::~TGaspardTrackerModule() GaspardTrackerModule::~GaspardTrackerModule()
{ {
} }
void TGaspardTrackerModule::InitializeIndex() void GaspardTrackerModule::InitializeIndex()
{ {
m_index["Square"] = 0; m_index["Square"] = 0;
m_index["Trapezoid"] = 100; m_index["Trapezoid"] = 100;
......
#ifndef TGaspardTrackerModule_h #ifndef GaspardTrackerModule_h
#define TGaspardTrackerModule_h 1 #define GaspardTrackerModule_h 1
// C++ headers // C++ headers
#include <string> #include <string>
...@@ -12,11 +12,11 @@ using namespace std; ...@@ -12,11 +12,11 @@ using namespace std;
class TGaspardTrackerModule class GaspardTrackerModule
{ {
public: public:
TGaspardTrackerModule(); GaspardTrackerModule();
virtual ~TGaspardTrackerModule(); virtual ~GaspardTrackerModule();
public: public:
// Read stream at Configfile to pick-up parameters of detector (Position,...) // Read stream at Configfile to pick-up parameters of detector (Position,...)
...@@ -32,6 +32,15 @@ public: ...@@ -32,6 +32,15 @@ public:
// Initialize the Index map for the different modules of Gaspard // Initialize the Index map for the different modules of Gaspard
void InitializeIndex(); void InitializeIndex();
// Pass the TGaspardTrackerData object from TGaspardTrackerPhysics to the
// classes deriving from GaspardTrackerModule
virtual void SetGaspardDataPointer(TGaspardTrackerData* gaspardData) = 0;
//
virtual double GetStripPositionX(Int_t DetectorNumber, Int_t stripX, Int_t stripY) = 0;
virtual double GetStripPositionY(Int_t DetectorNumber, Int_t stripX, Int_t stripY) = 0;
virtual double GetStripPositionZ(Int_t DetectorNumber, Int_t stripX, Int_t stripY) = 0;
protected: protected:
map<string, int> m_index; map<string, int> m_index;
}; };
......
/*****************************************************************************
* Copyright (C) 2009-2010 this file is part of the NPTool Project *
* *
* For the licensing terms see $NPTOOL/Licence/NPTool_Licence *
* For the list of contributors see $NPTOOL/Licence/Contributors *
*****************************************************************************/
/*****************************************************************************
* Original Author: N. de Sereville contact address: deserevi@ipno.in2p3.fr *
* *
* Creation Date : 31/08/09 *
* Last update : 10/09/09 *
*---------------------------------------------------------------------------*
* Decription: This class is mainly an interface to the *
* TGaspardTrackerPhysics class and it deals with the geometrical*
* correspondance between strip number and absolute coordinates *
* (X, Y, Z) of interaction. *
*---------------------------------------------------------------------------*
* Comment: *
* + 10/09/09: Add support for Square and DummyShape shapes *
* (N. de Sereville) *
* *
* *
*****************************************************************************/
#include "GaspardTrackerNew.h"
// C++ headers
#include <iostream>
#include <fstream>
#include <string>
#include <cmath>
#include <stdlib.h>
// NPL headers
#include "RootInput.h"
#include "RootOutput.h"
// ROOT headers
#include "TChain.h"
// Gaspard headers
#include "GaspardTrackerDummyShape.h"
#include "GaspardTrackerTrapezoid.h"
using namespace std ;
GaspardTrackerNew::GaspardTrackerNew()
: m_EventData (new TGaspardTrackerData()),
m_EventPhysics (new TGaspardTrackerPhysicsNew())
{
}
GaspardTrackerNew::~GaspardTrackerNew()
{
delete m_EventData;
delete m_EventPhysics;
}
void GaspardTrackerNew::Clear()
{
}
// Read stream at ConfigFile to pick-up parameters of detector (Position,...) using Token
void GaspardTrackerNew::ReadConfiguration(string Path)
{
// open configuration file
ifstream ConfigFile;
ConfigFile.open(Path.c_str());
bool GPDTrkSquare = false;
bool GPDTrkTrapezoid = false;
bool GPDTrkAnnular = false;
bool GPDTrkDummyShape = false;
string LineBuffer;
while (!ConfigFile.eof()) {
getline(ConfigFile, LineBuffer);
if (LineBuffer.compare(0, 9, "GPDSquare") == 0 && GPDTrkSquare == false) {
GPDTrkSquare = true;
/*
// instantiate a new "detector" corresponding to the Square elements
GaspardTrackerModule* myDetector = new GaspardTrackerSquare();
// Pass the data object to the GaspardTracker*** object
myDetector->SetGaspardDataPointer(m_EventData);
// read part of the configuration file corresponding to square elements
ConfigFile.close();
myDetector->ReadConfiguration(Path);
ConfigFile.open(Path.c_str());
*/ }
else if (LineBuffer.compare(0, 12, "GPDTrapezoid") == 0 && GPDTrkTrapezoid == false) {
GPDTrkTrapezoid = true;
// instantiate a new "detector" corresponding to the Trapezoid elements
GaspardTrackerModule* myDetector = new GaspardTrackerTrapezoid(m_ModulesMap);
// Pass the data object to the GaspardTracker*** object
myDetector->SetGaspardDataPointer(m_EventData);
// read part of the configuration file corresponding to trapezoid elements
ConfigFile.close();
myDetector->ReadConfiguration(Path);
ConfigFile.open(Path.c_str());
}
else if (LineBuffer.compare(0, 10, "GPDAnnular") == 0 && GPDTrkAnnular == false) {
GPDTrkAnnular = true;
/*
// instantiate a new "detector" corresponding to the Trapezoid elements
GaspardTrackerModule* myDetector = new GaspardTrackerAnnular();
// Pass the data object to the GaspardTracker*** object
myDetector->SetGaspardDataPointer(m_EventData);
// read part of the configuration file corresponding to trapezoid elements
ConfigFile.close();
myDetector->ReadConfiguration(Path);
ConfigFile.open(Path.c_str());
*/ }
else if (LineBuffer.compare(0, 13, "GPDDummyShape") == 0 && GPDTrkDummyShape == false) {
GPDTrkDummyShape = true;
// instantiate a new "detector" corresponding to the Shape elements
// The GaspardTrackerSquare class should be replaced by the
// GaspardTrackerShape class you need to define
GaspardTrackerModule* myDetector = new GaspardTrackerDummyShape(m_ModulesMap, m_EventPhysics);
// Pass the data object to the GaspardTracker*** object
myDetector->SetGaspardDataPointer(m_EventData);
// read part of the configuration file corresponding to shape elements
ConfigFile.close();
myDetector->ReadConfiguration(Path);
ConfigFile.open(Path.c_str());
}
}
}
// Read stream at Path and pick-up calibration parameter using Token
// If argument is "Simulation" no change calibration is loaded
void GaspardTrackerNew::ReadCalibrationFile(string Path)
{
/* // Order of Polynom function used for calibration
int Calibration_Si_E_Order;
int Calibration_Si_T_Order;
int Calibration_SiLi_E_Order;
int Calibration_CsI_E_Order;
// Calibration_Si_X_E[DetectorNumber][StripNumber][Order of Coeff]
vector< vector< vector< double > > > Calibration_Si_X_E ;
vector< vector< vector< double > > > Calibration_Si_X_T ;
vector< vector< vector< double > > > Calibration_Si_Y_E ;
vector< vector< vector< double > > > Calibration_Si_Y_T ;
// Calibration_SiLi_E[DetectorNumber][PadNumber][Order of Coeff]
vector< vector< vector< double > > > Calibration_SiLi_E ;
// Calibration_SiLi_E[DetectorNumber][CrystalNumber][Order of Coeff]
vector< vector< vector< double > > > Calibration_CsI_E ;
if (Path == "Simulation") { // Simulation case: data already calibrated
Calibration_Si_E_Order = 1;
Calibration_Si_T_Order = 1;
Calibration_SiLi_E_Order = 1;
Calibration_CsI_E_Order = 1;
vector<double> Coef;
// Order 0 Order 1
Coef.push_back(0) ; Coef.push_back(1) ;
vector< vector<double> > StripLine ;
StripLine.resize( 128 , Coef) ;
Calibration_Si_X_E.resize( m_NumberOfModule , StripLine) ;
Calibration_Si_X_T.resize( m_NumberOfModule , StripLine) ;
Calibration_Si_Y_E.resize( m_NumberOfModule , StripLine) ;
Calibration_Si_Y_T.resize( m_NumberOfModule , StripLine) ;
Calibration_SiLi_E.resize( m_NumberOfModule , StripLine) ;
Calibration_CsI_E .resize( m_NumberOfModule , StripLine) ;
}
else {
}
*/
}
// 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 GaspardTrackerNew::InitializeRootInput()
{
TChain* inputChain = RootInput::getInstance()->GetChain();
inputChain->SetBranchStatus("GASPARD", true);
inputChain->SetBranchStatus("fGPD*", true);
inputChain->SetBranchAddress("GASPARD", &m_EventData);
}
// Create associated branches and associated private member DetectorPhysics address
void GaspardTrackerNew::InitializeRootOutput()
{
TTree* outputTree = RootOutput::getInstance()->GetTree();
outputTree->Branch("GASPARD", "TGaspardTrackerPhysicsNew", &m_EventPhysics);
}
// 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 GaspardTrackerNew::BuildPhysicalEvent()
{
if (m_EventData->GetGPDTrkFirstStageFrontEMult() > 0) {
for (UInt_t i = 0; i < m_EventData->GetGPDTrkFirstStageFrontEMult(); i++) {
UShort_t detecNbr = m_EventData->GetGPDTrkFirstStageFrontEDetectorNbr(i);
m_ModulesMap[detecNbr]->BuildPhysicalEvent();
}
}
}
// 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.
// NB: This method can eventually be the same as BuildPhysicalEvent.
void GaspardTrackerNew::BuildSimplePhysicalEvent()
{
BuildPhysicalEvent();
}
void GaspardTrackerNew::DumpModulesMap()
{
cout << "GaspardTrackerNew::DumpMap()" << endl;
map<int, GaspardTrackerModule*>::iterator it;
for (it = m_ModulesMap.begin(); it != m_ModulesMap.end(); ++it) {
cout << "Module " << it->first << " -> Address " << it->second << endl;
}
}
double GaspardTrackerNew::GetEnergyDeposit()
{
if (m_EventPhysics->GetEventMultiplicity() > 0) {
return m_EventPhysics->GetTotalEnergy(0);
}
else
return -1000;
}
TVector3 GaspardTrackerNew::GetPositionOfInteraction()
{
TVector3 Position = TVector3(-1000,-1000,-1000);
if (m_EventPhysics->GetEventMultiplicity() == 1) {
Int_t ModuleNbr = m_EventPhysics->GetModuleNumber(0);
Int_t FrontPos = m_EventPhysics->GetFirstStageFrontPosition(0);
Int_t BackPos = m_EventPhysics->GetFirstStageBackPosition(0);
Position = TVector3(m_ModulesMap[ModuleNbr]->GetStripPositionX(ModuleNbr, FrontPos, BackPos),
m_ModulesMap[ModuleNbr]->GetStripPositionY(ModuleNbr, FrontPos, BackPos),
m_ModulesMap[ModuleNbr]->GetStripPositionZ(ModuleNbr, FrontPos, BackPos));
}
return Position;
}
/*****************************************************************************
* Copyright (C) 2009-2010 this file is part of the NPTool Project *
* *
* For the licensing terms see $NPTOOL/Licence/NPTool_Licence *
* For the list of contributors see $NPTOOL/Licence/Contributors *
*****************************************************************************/
/*****************************************************************************
* Original Author: N. de Sereville contact address: deserevi@ipno.in2p3.fr *
* *
* Creation Date : 31/08/09 *
* Last update : 10/09/09 *
*---------------------------------------------------------------------------*
* Decription: This class is mainly an interface to the *
* TGaspardTrackerPhysics class and it deals with the geometrical*
* correspondance between strip number and absolute coordinates *
* (X, Y, Z) of interaction. *
*---------------------------------------------------------------------------*
* Comment: *
* + 10/09/09: Add support for Square and DummyShape shapes *
* (N. de Sereville) *
* *
* *
*****************************************************************************/
#ifndef GaspardTrackerNew_H
// NPL
#include "../include/VDetector.h"
#include "TGaspardTrackerData.h"
#include "TGaspardTrackerPhysicsNew.h"
#include "GaspardTrackerModule.h"
// C++
#include <map>
#include <vector>
// Root
#include "TObject.h"
#include "TVector3.h"
class GaspardTrackerNew : public NPA::VDetector
{
public:
GaspardTrackerNew();
virtual ~GaspardTrackerNew();
public:
void Clear() ;
void Clear(const Option_t*) {};
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();
// 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.
// NB: This method can eventually be the same as BuildPhysicalEvent.
void BuildSimplePhysicalEvent();
// Those two method all to clear the Event Physics or Data
void ClearEventPhysics() {m_EventPhysics->Clear();}
void ClearEventData() {m_EventData->Clear();}
public:
void DumpModulesMap();
private:
map<int, GaspardTrackerModule*> m_ModulesMap;
public:
// Get Root input and output objects
TGaspardTrackerData* GetEventData() {return m_EventData;}
TGaspardTrackerPhysicsNew* GetEventPhysics() {return m_EventPhysics;}
// To be called after a build Physical Event
double GetEnergyDeposit();
TVector3 GetPositionOfInteraction();
private:
////////////////////////////////////////
// Root Input and Output tree classes //
////////////////////////////////////////
TGaspardTrackerData* m_EventData;
TGaspardTrackerPhysicsNew* m_EventPhysics;
};
#endif
#include "TGaspardTrackerTrapezoid.h" #include "GaspardTrackerTrapezoid.h"
// C++ headers // C++ headers
#include <iostream> #include <iostream>
...@@ -7,21 +7,22 @@ ...@@ -7,21 +7,22 @@
#include <cmath> #include <cmath>
TGaspardTrackerTrapezoid::TGaspardTrackerTrapezoid(map<int, TGaspardTrackerModule*> &Module) GaspardTrackerTrapezoid::GaspardTrackerTrapezoid(map<int, GaspardTrackerModule*> &Module)
: m_ModuleTest(Module), : m_ModuleTest(Module),
m_EventData(0),
m_NumberOfModule(0) m_NumberOfModule(0)
{ {
} }
TGaspardTrackerTrapezoid::~TGaspardTrackerTrapezoid() GaspardTrackerTrapezoid::~GaspardTrackerTrapezoid()
{ {
} }
void TGaspardTrackerTrapezoid::ReadConfiguration(string Path) void GaspardTrackerTrapezoid::ReadConfiguration(string Path)
{ {
ifstream ConfigFile; ifstream ConfigFile;
ConfigFile.open(Path.c_str()); ConfigFile.open(Path.c_str());
...@@ -209,19 +210,19 @@ void TGaspardTrackerTrapezoid::ReadConfiguration(string Path) ...@@ -209,19 +210,19 @@ void TGaspardTrackerTrapezoid::ReadConfiguration(string Path)
void TGaspardTrackerTrapezoid::BuildPhysicalEvent() void GaspardTrackerTrapezoid::BuildPhysicalEvent()
{ {
} }
void TGaspardTrackerTrapezoid::BuildSimplePhysicalEvent() void GaspardTrackerTrapezoid::BuildSimplePhysicalEvent()
{ {
} }
void TGaspardTrackerTrapezoid::AddModule(TVector3 C_X1_Y1, void GaspardTrackerTrapezoid::AddModule(TVector3 C_X1_Y1,
TVector3 C_X128_Y1, TVector3 C_X128_Y1,
TVector3 C_X1_Y128, TVector3 C_X1_Y128,
TVector3 C_X128_Y128) TVector3 C_X128_Y128)
...@@ -287,7 +288,7 @@ void TGaspardTrackerTrapezoid::AddModule(TVector3 C_X1_Y1, ...@@ -287,7 +288,7 @@ void TGaspardTrackerTrapezoid::AddModule(TVector3 C_X1_Y1,
void TGaspardTrackerTrapezoid::AddModule(double theta, void GaspardTrackerTrapezoid::AddModule(double theta,
double phi, double phi,
double distance, double distance,
double beta_u, double beta_u,
......
#ifndef TGaspardTrackerTrapezoid_h #ifndef GaspardTrackerTrapezoid_h
#define TGaspardTrackerTrapezoid_h 1 #define GaspardTrackerTrapezoid_h 1
// C++ headers // C++ headers
#include <string> #include <string>
...@@ -12,20 +12,20 @@ ...@@ -12,20 +12,20 @@
#include "TVector3.h" #include "TVector3.h"
// Gaspard headers // Gaspard headers
#include "TGaspardTrackerModule.h" #include "GaspardTrackerModule.h"
using namespace std; using namespace std;
class TGaspardTrackerTrapezoid : public TGaspardTrackerModule class GaspardTrackerTrapezoid : public GaspardTrackerModule
{ {
public: public:
//////////////////////////////////////////////////// ////////////////////////////////////////////////////
/////// Default Constructor and Destructor ///////// /////// Default Constructor and Destructor /////////
//////////////////////////////////////////////////// ////////////////////////////////////////////////////
TGaspardTrackerTrapezoid(map<int, TGaspardTrackerModule*> &Module); GaspardTrackerTrapezoid(map<int, GaspardTrackerModule*> &Module);
virtual ~TGaspardTrackerTrapezoid(); virtual ~GaspardTrackerTrapezoid();
public: public:
//////////////////////////////////////////////////// ////////////////////////////////////////////////////
...@@ -42,7 +42,15 @@ public: ...@@ -42,7 +42,15 @@ public:
void BuildSimplePhysicalEvent(); void BuildSimplePhysicalEvent();
private: private:
map<int, TGaspardTrackerModule*> &m_ModuleTest; map<int, GaspardTrackerModule*> &m_ModuleTest;
public:
void SetGaspardDataPointer(TGaspardTrackerData* gaspardData) {m_EventData = gaspardData;};
private:
// Gaspard data coming from TGaspardTrackerPhysics through the
// SetGaspardDataPointer method
TGaspardTrackerData* m_EventData;
public: public:
//////////////////////////////// ////////////////////////////////
......
...@@ -287,26 +287,28 @@ libGaspardPhysics.so: GaspardTracker.o TGaspardTrackerPhysics.o TGaspardTrackerP ...@@ -287,26 +287,28 @@ libGaspardPhysics.so: GaspardTracker.o TGaspardTrackerPhysics.o TGaspardTrackerP
TGaspardTrackerPhysicsDict.cxx: TGaspardTrackerPhysics.h TGaspardTrackerPhysicsDict.cxx: TGaspardTrackerPhysics.h
rootcint -f $@ -c $^ rootcint -f $@ -c $^
libGaspardPhysicsNew.so: TGaspardTrackerPhysicsNew.o TGaspardTrackerPhysicsNewDict.o libGaspardPhysicsNew.so: GaspardTrackerNew.o TGaspardTrackerPhysicsNew.o \
TGaspardTrackerPhysicsNewDict.o
$(LD) $(SOFLAGS) $^ $(OutPutOpt) $@ $(LD) $(SOFLAGS) $^ $(OutPutOpt) $@
TGaspardTrackerPhysicsNewDict.cxx: TGaspardTrackerPhysicsNew.h TGaspardTrackerPhysicsNewDict.cxx: TGaspardTrackerPhysicsNew.h
rootcint -f $@ -c $^ rootcint -f $@ -c $^
libGaspardTrackerModules.so: TGaspardTrackerModule.o TGaspardTrackerDummyShape.o \ libGaspardTrackerModules.so: GaspardTrackerModule.o GaspardTrackerDummyShape.o \
TGaspardTrackerTrapezoid.o GaspardTrackerTrapezoid.o
$(LD) $(SOFLAGS) $^ $(OutPutOpt) $@ $(LD) $(SOFLAGS) $^ $(OutPutOpt) $@
# dependances # dependances
GaspardTracker.o: GaspardTracker.cxx GaspardTracker.h GaspardTracker.o: GaspardTracker.cxx GaspardTracker.h
GaspardTrackerNew.o: GaspardTrackerNew.cxx GaspardTrackerNew.h
TGaspardTrackerData.o: TGaspardTrackerData.cxx TGaspardTrackerData.h TGaspardTrackerData.o: TGaspardTrackerData.cxx TGaspardTrackerData.h
TGaspardTrackerPhysics.o: TGaspardTrackerPhysics.cxx TGaspardTrackerPhysics.h TGaspardTrackerPhysics.o: TGaspardTrackerPhysics.cxx TGaspardTrackerPhysics.h
TGaspardTrackerPhysicsNew.o: TGaspardTrackerPhysicsNew.cxx TGaspardTrackerPhysicsNew.h TGaspardTrackerPhysicsNew.o: TGaspardTrackerPhysicsNew.cxx TGaspardTrackerPhysicsNew.h
TGaspardTrackerModule.o: TGaspardTrackerModule.cxx TGaspardTrackerModule.h GaspardTrackerModule.o: GaspardTrackerModule.cxx GaspardTrackerModule.h
TGaspardTrackerDummyShape.o: TGaspardTrackerDummyShape.cxx TGaspardTrackerDummyShape.h GaspardTrackerDummyShape.o: GaspardTrackerDummyShape.cxx GaspardTrackerDummyShape.h
TGaspardTrackerTrapezoid.o: TGaspardTrackerTrapezoid.cxx TGaspardTrackerTrapezoid.h GaspardTrackerTrapezoid.o: GaspardTrackerTrapezoid.cxx GaspardTrackerTrapezoid.h
####################################### #######################################
############# Clean and More ########## ############# Clean and More ##########
......
...@@ -24,9 +24,11 @@ ...@@ -24,9 +24,11 @@
#ifndef TGASPARDTRACKERPHYSICS_H #ifndef TGASPARDTRACKERPHYSICS_H
#define TGASPARDTRACKERPHYSICS_H #define TGASPARDTRACKERPHYSICS_H
#include <vector>
#include "TObject.h"
#include "TGaspardTrackerData.h" #include "TGaspardTrackerData.h"
#include "TObject.h"
#include <vector>
#include <cstdlib> #include <cstdlib>
using namespace std ; using namespace std ;
......
...@@ -9,259 +9,57 @@ ...@@ -9,259 +9,57 @@
* 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 : 10/09/09 * * Last update : *
*---------------------------------------------------------------------------* *---------------------------------------------------------------------------*
* Decription: This class is mainly an interface to the * * Decription: This class stores the physical results after NPAnalysis is run*
* TGaspardTrackerPhysics class and it deals with the geometrical* * for the tracker part of the Gaspard detector. *
* correspondance between strip number and absolute coordinates * * This class derives from TObject (ROOT) and its aim is to be *
* (X, Y, Z) of interaction. * * stored in the output TTree of NPAnalysis. *
*---------------------------------------------------------------------------* *---------------------------------------------------------------------------*
* Comment: * * Comment: *
* + 10/09/09: Add support for Square and DummyShape shapes *
* (N. de Sereville) *
* * * *
* * * *
*****************************************************************************/ *****************************************************************************/
#include "TGaspardTrackerPhysicsNew.h" #include "TGaspardTrackerPhysicsNew.h"
// C++ headers
#include <iostream>
#include <fstream>
#include <string>
#include <cmath>
#include <stdlib.h>
// NPL headers ClassImp(TGaspardTrackerPhysicsNew)
#include "RootInput.h"
#include "RootOutput.h"
// ROOT headers
#include "TChain.h"
// Gaspard headers TGaspardTrackerPhysicsNew::TGaspardTrackerPhysicsNew()
#include "TGaspardTrackerDummyShape.h"
#include "TGaspardTrackerTrapezoid.h"
using namespace std ;
TGaspardTrackerPhysicsNew::TGaspardTrackerPhysicsNew()
: m_EventData (new TGaspardTrackerData()),
m_EventPhysics (this)
{
}
TGaspardTrackerPhysicsNew::~TGaspardTrackerPhysicsNew()
{
delete m_EventData;
delete m_EventPhysics;
}
void TGaspardTrackerPhysicsNew::Clear()
{
}
// Read stream at ConfigFile to pick-up parameters of detector (Position,...) using Token
void TGaspardTrackerPhysicsNew::ReadConfiguration(string Path)
{ {
// open configuration file
ifstream ConfigFile;
ConfigFile.open(Path.c_str());
bool GPDTrkSquare = false;
bool GPDTrkTrapezoid = false;
bool GPDTrkAnnular = false;
bool GPDTrkDummyShape = false;
string LineBuffer;
while (!ConfigFile.eof()) {
getline(ConfigFile, LineBuffer);
if (LineBuffer.compare(0, 9, "GPDSquare") == 0 && GPDTrkSquare == false) {
GPDTrkSquare = true;
/*
// instantiate a new "detector" corresponding to the Square elements
TGaspardTrackerModule* myDetector = new TGaspardTrackerSquare();
// read part of the configuration file corresponding to square elements
ConfigFile.close();
myDetector->ReadConfiguration(Path);
ConfigFile.open(Path.c_str());
*/ }
else if (LineBuffer.compare(0, 12, "GPDTrapezoid") == 0 && GPDTrkTrapezoid == false) {
GPDTrkTrapezoid = true;
// instantiate a new "detector" corresponding to the Trapezoid elements
TGaspardTrackerModule* myDetector = new TGaspardTrackerTrapezoid(m_ModulesMap);
// read part of the configuration file corresponding to trapezoid elements
ConfigFile.close();
myDetector->ReadConfiguration(Path);
ConfigFile.open(Path.c_str());
}
else if (LineBuffer.compare(0, 10, "GPDAnnular") == 0 && GPDTrkAnnular == false) {
GPDTrkAnnular = true;
/*
// instantiate a new "detector" corresponding to the Trapezoid elements
TGaspardTrackerModule* myDetector = new TGaspardTrackerAnnular();
// read part of the configuration file corresponding to trapezoid elements
ConfigFile.close();
myDetector->ReadConfiguration(Path);
ConfigFile.open(Path.c_str());
*/ }
else if (LineBuffer.compare(0, 13, "GPDDummyShape") == 0 && GPDTrkDummyShape == false) {
GPDTrkDummyShape = true;
// instantiate a new "detector" corresponding to the Shape elements
// The GaspardTrackerSquare class should be replaced by the
// GaspardTrackerShape class you need to define
TGaspardTrackerModule* myDetector = new TGaspardTrackerDummyShape(m_ModulesMap);
// read part of the configuration file corresponding to shape elements
ConfigFile.close();
myDetector->ReadConfiguration(Path);
ConfigFile.open(Path.c_str());
}
}
DumpMap();
} }
// Read stream at Path and pick-up calibration parameter using Token
// If argument is "Simulation" no change calibration is loaded
void TGaspardTrackerPhysicsNew::ReadCalibrationFile(string Path)
{
/* // Order of Polynom function used for calibration
int Calibration_Si_E_Order;
int Calibration_Si_T_Order;
int Calibration_SiLi_E_Order;
int Calibration_CsI_E_Order;
// Calibration_Si_X_E[DetectorNumber][StripNumber][Order of Coeff]
vector< vector< vector< double > > > Calibration_Si_X_E ;
vector< vector< vector< double > > > Calibration_Si_X_T ;
vector< vector< vector< double > > > Calibration_Si_Y_E ;
vector< vector< vector< double > > > Calibration_Si_Y_T ;
// Calibration_SiLi_E[DetectorNumber][PadNumber][Order of Coeff]
vector< vector< vector< double > > > Calibration_SiLi_E ;
// Calibration_SiLi_E[DetectorNumber][CrystalNumber][Order of Coeff]
vector< vector< vector< double > > > Calibration_CsI_E ;
if (Path == "Simulation") { // Simulation case: data already calibrated
Calibration_Si_E_Order = 1;
Calibration_Si_T_Order = 1;
Calibration_SiLi_E_Order = 1;
Calibration_CsI_E_Order = 1;
vector<double> Coef; TGaspardTrackerPhysicsNew::~TGaspardTrackerPhysicsNew()
// Order 0 Order 1
Coef.push_back(0) ; Coef.push_back(1) ;
vector< vector<double> > StripLine ;
StripLine.resize( 128 , Coef) ;
Calibration_Si_X_E.resize( m_NumberOfModule , StripLine) ;
Calibration_Si_X_T.resize( m_NumberOfModule , StripLine) ;
Calibration_Si_Y_E.resize( m_NumberOfModule , StripLine) ;
Calibration_Si_Y_T.resize( m_NumberOfModule , StripLine) ;
Calibration_SiLi_E.resize( m_NumberOfModule , StripLine) ;
Calibration_CsI_E .resize( m_NumberOfModule , StripLine) ;
}
else {
}
*/
}
// 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 TGaspardTrackerPhysicsNew::InitializeRootInput()
{
TChain* inputChain = RootInput::getInstance()->GetChain();
inputChain->SetBranchStatus("GASPARD", true);
inputChain->SetBranchStatus("fGPD*", true);
inputChain->SetBranchAddress("GASPARD", &m_EventData);
}
// Create associated branches and associated private member DetectorPhysics address
void TGaspardTrackerPhysicsNew::InitializeRootOutput()
{
TTree* outputTree = RootOutput::getInstance()->GetTree();
outputTree->Branch("GASPARD", "TGaspardTrackerPhysicsNew", &m_EventPhysics);
}
// 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 TGaspardTrackerPhysicsNew::BuildPhysicalEvent()
{
/* if (m_ModulesMap.size() > 0) {
for (UInt_t i = 0; i < m_ModulesMap.size(); i++) {
m_ModulesMap[i]->BuildPhysicalEvent();
}
}*/
}
void TGaspardTrackerPhysicsNew::DumpMap()
{
cout << "TGaspardTrackerPhysicsNew::DumpMap()" << endl;
map<int, TGaspardTrackerModule*>::iterator it;
for (it = m_ModulesMap.begin(); it != m_ModulesMap.end(); ++it) {
cout << "Module " << it->first << " -> Address " << it->second << endl;
}
}
// 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.
// NB: This method can eventually be the same as BuildPhysicalEvent.
void TGaspardTrackerPhysicsNew::BuildSimplePhysicalEvent()
{ {
BuildPhysicalEvent(); Clear();
}
double TGaspardTrackerPhysicsNew::GetEnergyDeposit()
{
/* if (m_EventPhysics->TotalEnergy.size() > 0)
return m_EventPhysics->TotalEnergy[0];
else*/
return -1000;
} }
TVector3 TGaspardTrackerPhysicsNew::GetPositionOfInteraction() void TGaspardTrackerPhysicsNew::Clear()
{ {
TVector3 Position = TVector3(-1000,-1000,-1000); // General members
fEventType.clear();
/* if (m_EventPhysics->ModuleNumber.size() == 1) { fModuleNumber.clear();
Position = TVector3(GetStripPositionX(m_EventPhysics->ModuleNumber[0], m_EventPhysics->FirstStage_X[0], m_EventPhysics->FirstStage_Y[0]), fTotalEnergy.clear();
GetStripPositionY(m_EventPhysics->ModuleNumber[0], m_EventPhysics->FirstStage_X[0], m_EventPhysics->FirstStage_Y[0]),
GetStripPositionZ(m_EventPhysics->ModuleNumber[0], m_EventPhysics->FirstStage_X[0], m_EventPhysics->FirstStage_Y[0])); // First stage
} fFirstStage_Energy.clear();
*/ fFirstStage_Time.clear();
return(Position); fFirstStage_FrontPosition.clear();
fFirstStage_BackPosition.clear();
// Second stage
fSecondStage_Energy.clear();
fSecondStage_Time.clear();
fSecondStage_Position.clear();
// Third stage
fThirdStage_Energy.clear();
fThirdStage_Time.clear();
fThirdStage_Position.clear();
} }
...@@ -9,99 +9,120 @@ ...@@ -9,99 +9,120 @@
* 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 : 10/09/09 * * Last update : 08/10/10 *
*---------------------------------------------------------------------------* *---------------------------------------------------------------------------*
* Decription: This class is mainly an interface to the * * Decription: This class stores the physical results after NPAnalysis is run*
* TGaspardTrackerPhysics class and it deals with the geometrical* * for the tracker part of the Gaspard detector. *
* correspondance between strip number and absolute coordinates * * This class derives from TObject (ROOT) and its aim is to be *
* (X, Y, Z) of interaction. * * stored in the output TTree of NPAnalysis. *
*---------------------------------------------------------------------------* *---------------------------------------------------------------------------*
* Comment: * * Comment: *
* + 10/09/09: Add support for Square and DummyShape shapes * * + 08/10/10: Change private member names and add setters and getters *
* (N. de Sereville) * * methods. BuildPhysicalEvent() method is moved to the *
* TGaspardTracker*** classes (N. de Sereville) *
* * * *
* * * *
*****************************************************************************/ *****************************************************************************/
#ifndef TGaspardTrackerPhysicsNew_H #ifndef TGASPARDTRACKERPHYSICSNEW_H
#define TGASPARDTRACKERPHYSICSNEW_H
// NPL
#include "../include/VDetector.h"
#include "TGaspardTrackerData.h" #include "TGaspardTrackerData.h"
#include "TGaspardTrackerModule.h"
// ROOT
#include "TObject.h"
// C++ // C++
#include <map>
#include <vector> #include <vector>
// Root using namespace std ;
#include "TObject.h"
#include "TVector3.h"
class TGaspardTrackerPhysicsNew : public TObject, public NPA::VDetector
class TGaspardTrackerPhysicsNew : public TObject
{ {
public: public:
TGaspardTrackerPhysicsNew(); TGaspardTrackerPhysicsNew();
virtual ~TGaspardTrackerPhysicsNew(); ~TGaspardTrackerPhysicsNew();
public:
void Clear() ;
void Clear(const Option_t*) {};
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 public:
// If argument is "Simulation" no change calibration is loaded void Clear();
void ReadCalibrationFile(string); void Clear(const Option_t*) {};
// 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 private:
void InitializeRootOutput(); vector<Int_t> fEventType;
vector<Int_t> fModuleNumber;
// This method is called at each event read from the Input Tree. // First stage
// The aim is to build treat Raw dat in order to extract physical parameter. vector<Double_t> fFirstStage_Energy;
void BuildPhysicalEvent(); vector<Double_t> fFirstStage_Time;
vector<Int_t> fFirstStage_FrontPosition;
// Same as above, but only the simplest event and/or simple method are used (low multiplicity, faster algorythm but less efficient ...). vector<Int_t> fFirstStage_BackPosition;
// This method aimed to be used for analysis performed during experiment, when speed is requiered.
// NB: This method can eventually be the same as BuildPhysicalEvent.
void BuildSimplePhysicalEvent();
// Those two method all to clear the Event Physics or Data // Second stage
void ClearEventPhysics() {m_EventPhysics->Clear();} vector<Double_t> fSecondStage_Energy;
void ClearEventData() {m_EventData->Clear();} vector<Double_t> fSecondStage_Time;
vector<Int_t> fSecondStage_Position;
// Third stage
vector<Double_t> fThirdStage_Energy;
vector<Double_t> fThirdStage_Time;
vector<Int_t> fThirdStage_Position;
public: vector<Double_t> fTotalEnergy;
void DumpMap();
private:
map<int, TGaspardTrackerModule*> m_ModulesMap; //!
public: public:
// Get Root input and output objects /////////////////////////////////////
TGaspardTrackerData* GetEventData() {return m_EventData;} // SETTERS //
TGaspardTrackerPhysicsNew* GetEventPhysics() {return m_EventPhysics;} /////////////////////////////////////
// General
// To be called after a build Physical Event void SetEventType(Int_t evtType) {fEventType.push_back(evtType);}
double GetEnergyDeposit(); void SetModuleNumber(Int_t moduleNbr) {fModuleNumber.push_back(moduleNbr);}
TVector3 GetPositionOfInteraction(); void SetTotalEnergy(Double_t ener) {fTotalEnergy.push_back(ener);}
// First stage
void SetFirstStageEnergy(Double_t ener) {fFirstStage_Energy.push_back(ener);}
void SetFirstStageTime(Double_t time) {fFirstStage_Time.push_back(time);}
void SetFirstStageFrontPosition(Int_t x) {fFirstStage_FrontPosition.push_back(x);}
void SetFirstStageBackPosition(Int_t y) {fFirstStage_BackPosition.push_back(y);}
// Second stage
void SetSecondStageEnergy(Double_t ener) {fSecondStage_Energy.push_back(ener);}
void SetSecondStageTime(Double_t time) {fSecondStage_Time.push_back(time);}
void SetSecondStagePosition(Int_t pos) {fSecondStage_Position.push_back(pos);}
// Third stage
void SetThirdStageEnergy(Double_t ener) {fThirdStage_Energy.push_back(ener);}
void SetThirdStageTime(Double_t time) {fThirdStage_Time.push_back(time);}
void SetThirdStagePosition(Int_t pos) {fThirdStage_Position.push_back(pos);}
private: /////////////////////////////////////
//////////////////////////////////////// // GETTERS //
// Root Input and Output tree classes // /////////////////////////////////////
//////////////////////////////////////// // General
TGaspardTrackerData* m_EventData; //! Int_t GetEventMultiplicity() {return fTotalEnergy.size();}
TGaspardTrackerPhysicsNew* m_EventPhysics; //! Int_t GetEventType(Int_t i) {return fEventType.at(i);}
Int_t GetModuleNumber(Int_t i) {return fModuleNumber.at(i);}
Double_t GetTotalEnergy(Int_t i) {return fTotalEnergy.at(i);}
// First stage
Double_t GetFirstStageEnergy(Int_t i) {return fFirstStage_Energy.at(i);}
Double_t GetFirstStageTime(Int_t i) {return fFirstStage_Time.at(i);}
Int_t GetFirstStageFrontPosition(Int_t i) {return fFirstStage_FrontPosition.at(i);}
Int_t GetFirstStageBackPosition(Int_t i) {return fFirstStage_BackPosition.at(i);}
// Second stage
Double_t GetSecondStageEnergy(Int_t i) {return fSecondStage_Energy.at(i);}
Double_t GetSecondStageTime(Int_t i) {return fSecondStage_Time.at(i);}
Int_t GetSecondStagePosition(Int_t i) {return fSecondStage_Position.at(i);}
// Third stage
Double_t GetThirdStageEnergy(Int_t i) {return fThirdStage_Energy.at(i);}
Double_t GetThirdStageTime(Int_t i) {return fThirdStage_Time.at(i);}
Int_t GetThirdStagePosition(Int_t i) {return fThirdStage_Position.at(i);}
ClassDef(TGaspardTrackerPhysicsNew,1) // TGaspardTrackerPyysicsNew structure
}; };
#endif #endif
...@@ -294,6 +294,7 @@ Vdetec: ...@@ -294,6 +294,7 @@ Vdetec:
cp ./VDetector/*.so ./lib cp ./VDetector/*.so ./lib
ifeq ($(ARCH),macosx) ifeq ($(ARCH),macosx)
cd lib; ln -sf libVDetector.so libVDetector.dylib cd lib; ln -sf libVDetector.so libVDetector.dylib
cd lib; ln -sf libDetectorManager.so libDetectorManager.dylib
endif endif
## MUST2 ## ## MUST2 ##
...@@ -329,6 +330,8 @@ GaspardData: ...@@ -329,6 +330,8 @@ GaspardData:
ifeq ($(ARCH),macosx) ifeq ($(ARCH),macosx)
cd lib; ln -sf libGaspardData.so libGaspardData.dylib cd lib; ln -sf libGaspardData.so libGaspardData.dylib
cd lib; ln -sf libGaspardPhysics.so libGaspardPhysics.dylib cd lib; ln -sf libGaspardPhysics.so libGaspardPhysics.dylib
cd lib; ln -sf libGaspardTrackerModules.so libGaspardTrackerModules.dylib
cd lib; ln -sf libGaspardPhysicsNew.so libGaspardPhysicsNew.dylib
endif endif
## Plastic ## ## Plastic ##
......
...@@ -10,7 +10,7 @@ ...@@ -10,7 +10,7 @@
#include "../SSSD/TSSSDPhysics.h" #include "../SSSD/TSSSDPhysics.h"
#include "../Plastic/TPlasticPhysics.h" #include "../Plastic/TPlasticPhysics.h"
#include "../GASPARD/GaspardTracker.h" #include "../GASPARD/GaspardTracker.h"
#include "../GASPARD/TGaspardTrackerPhysicsNew.h" #include "../GASPARD/GaspardTrackerNew.h"
#include "../Paris/Paris.h" #include "../Paris/Paris.h"
#include "../Shield/Shield.h" #include "../Shield/Shield.h"
...@@ -78,8 +78,7 @@ void DetectorManager::ReadConfigurationFile(string Path) ...@@ -78,8 +78,7 @@ void DetectorManager::ReadConfigurationFile(string Path)
cout << "//////// Gaspard Tracker ////////" << endl; cout << "//////// Gaspard Tracker ////////" << endl;
// Instantiate the new array as a VDetector Object // Instantiate the new array as a VDetector Object
// VDetector* myDetector = new GaspardTracker(); VDetector* myDetector = new GaspardTrackerNew();
VDetector* myDetector = new TGaspardTrackerPhysicsNew();
// Read Position of Telescope // Read Position of Telescope
ConfigFile.close(); ConfigFile.close();
......
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