Commit 1de39bc1 authored by Adrien Matta's avatar Adrien Matta
Browse files

* fixing // issue in RootOutput causing crashes on some linux distro

parent 61c0e18b
......@@ -85,6 +85,11 @@ RootOutput::RootOutput(std::string fileNameBase, std::string treeNameBase,bool s
if (fileNameBase.find("root")==std::string::npos)
pBaseName += ".root";
// removing "//" from path
while(size_t pos = pBaseName.find("//")!=std::string::npos){
pBaseName.erase(pos);
}
if(pSplit){
// Create a folder for all the trees
string stripname = pBaseName;
......
......@@ -403,7 +403,7 @@ bool TMugastPhysics::IsValidChannel(const int& Type,
///////////////////////////////////////////////////////////////////////////
void TMugastPhysics::ReadAnalysisConfig() {
NPL::InputParser parser("./configs/ConfigMugast.dat");
NPL::InputParser parser("./configs/ConfigMugast.dat",false);
vector<NPL::InputBlock*> blocks = parser.GetAllBlocksWithToken("ConfigMugast");
cout << endl << "//// Read MUGAST analysis configuration" <<endl;
......
......@@ -61,14 +61,18 @@ void TSamuraiBDCPhysics::BuildSimplePhysicalEvent(){
///////////////////////////////////////////////////////////////////////////
void TSamuraiBDCPhysics::BuildPhysicalEvent(){
PreTreat();
/*
static unsigned int det,layer,wire,size;
for(auto it = Layer.begin(); it!=Layer.end(); it++){
for(auto it = m_DCHit.begin(); it!=m_DCHit.end(); it++){
det = it->first;
size = it->second.size();
for (auto itt = it->second.begin(); itt != it->second.end(); itt++){
double angle = itt->first;
// cout << det << " " << angle << " " << itt->second.size() << endl;
}
}
/*
// RemoveNoise();
// Map[plane angle, vector of spatial information]
......@@ -251,12 +255,10 @@ void TSamuraiBDCPhysics::PreTreat(){
}
// a valid wire must have an edge
if(etime && time && etime-time>ToTThreshold_L && etime-time<ToTThreshold_H){
Layer[det].push_back(layer);
Wire[det].push_back(wire);
Time[det].push_back(time);
ToT[det].push_back(etime-time);
channel="SamuraiBDC"+NPL::itoa(det)+"/L" + NPL::itoa(layer);
DriftLength[det].push_back(2.5-Cal->ApplySigmoid(channel,etime));
SamuraiDCIndex idx(det,layer,wire);
double angle = Wire_Angle[idx];
m_DCHit[det][angle].push_back(DCHit(layer,wire,time,etime-time,2.5-Cal->ApplySigmoid(channel,etime)));
}
}
......@@ -265,13 +267,14 @@ void TSamuraiBDCPhysics::PreTreat(){
}
///////////////////////////////////////////////////////////////////////////
void TSamuraiBDCPhysics::Clear(){
DriftLength.clear();
m_DCHit.clear();
/* DriftLength.clear();
Detector.clear();
Layer.clear();
Wire.clear();
Time.clear();
ToT.clear();
*/
// Computed variable
ParticleDirection.clear();
MiddlePosition.clear();
......
......@@ -48,24 +48,40 @@
// Forward declaration
//class TSamuraiBDCSpectra;
class DCHit{
public:
DCHit(unsigned int layer , unsigned int wire, double time, double tot, double drift){
Layer=layer;
Wire=wire;
Time=time;
ToT=tot;
DriftLength=drift;
}
DCHit(){};
~DCHit(){};
private:
unsigned int Layer;
unsigned int Wire;
double Time;
double ToT;
double DriftLength;
};
class TSamuraiBDCPhysics : public TObject, public NPL::VDetector{
public:
TSamuraiBDCPhysics();
~TSamuraiBDCPhysics() {};
friend class DCHit;
public:
void Clear();
void Clear(const Option_t*) {};
public:
// map of [bdc number, vector of info]
std::map<unsigned int,std::vector<double>> DriftLength;
std::map<unsigned int,std::vector<int>> Layer;
std::map<unsigned int,std::vector<int>> Wire;
std::map<unsigned int,std::vector<double>> Time;
std::map<unsigned int,std::vector<double>> ToT;
// double map of [bdc number][layer angle]=vector of hit
std::map<unsigned int,std::map<double,std::vector<DCHit>>> m_DCHit;
// Computed variable
std::map<unsigned int, std::vector<TVector3> > ParticleDirection;
......@@ -90,7 +106,7 @@ class TSamuraiBDCPhysics : public TObject, public NPL::VDetector{
std::map<SamuraiDCIndex,double> Wire_X;//! X position of the wires
std::map<SamuraiDCIndex,double> Wire_Z;//! Z position of the wires
std::map<SamuraiDCIndex,double> Wire_Angle;//! Wire Angle (0 for X, 90 for Y, U and V are typically at +/-30)
private: // Analysis
double ToTThreshold_H;//! a ToT Low threshold to remove noise
double ToTThreshold_L;//! a ToT High threshold to remove noise
......@@ -101,11 +117,11 @@ class TSamuraiBDCPhysics : public TObject, public NPL::VDetector{
// Construct the 2D track and ref position at Z=0 and Z=100 based on X,Z and Radius provided
// Object use to perform the DC reconstruction
#if __cplusplus > 199711L && NPMULTITHREADING
#if __cplusplus > 199711L && NPMULTITHREADING
NPL::DCReconstructionMT m_reconstruction;//!
#else
#else
NPL::DCReconstruction m_reconstruction;//!
#endif
#endif
public: // Innherited from VDetector Class
......@@ -165,7 +181,7 @@ class TSamuraiBDCPhysics : public TObject, public NPL::VDetector{
// Retrieve raw and pre-treated data
TSamuraiBDCData* GetRawData() const {return m_EventData;}
TSamuraiBDCData* GetPreTreatedData() const {return m_PreTreatedData;}
double GetPosX(unsigned int det) {return PosX[det];}
double GetPosY(unsigned int det) {return PosY[det];}
double GetThetaX(unsigned int det){return ThetaX[det];}
......@@ -181,7 +197,7 @@ class TSamuraiBDCPhysics : public TObject, public NPL::VDetector{
private: // Spectra Class
// TSamuraiBDCSpectra* m_Spectra; // !
// TSamuraiBDCSpectra* m_Spectra; // !
public: // Spectra Getter
std::map< std::string , TH1*> GetSpectra();
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment