diff --git a/NPAnalysis/10He_Riken/Analysis b/NPAnalysis/10He_Riken/Analysis index 3e625e9ebfdc156ac50537168b430e60caf1f307..b768b4a077d09084adc810427cf9d75063298eb6 100755 Binary files a/NPAnalysis/10He_Riken/Analysis and b/NPAnalysis/10He_Riken/Analysis differ diff --git a/NPAnalysis/10He_Riken/include/ObjectManager.hh b/NPAnalysis/10He_Riken/include/ObjectManager.hh index fe9f125c243510c8fcb00a901b4b5ea9cd3f55b4..a574b5198d434aee3dd43eb5d14532eb53345557 100644 --- a/NPAnalysis/10He_Riken/include/ObjectManager.hh +++ b/NPAnalysis/10He_Riken/include/ObjectManager.hh @@ -26,13 +26,14 @@ #include <TRandom.h> // NPL -#include "TMust2Data.h" -#include "TMust2Physics.h" #include "TPlasticData.h" #include "NPReaction.h" #include "RootInput.h" #include "RootOutput.h" #include "TInitialConditions.h" +#include "TMust2Physics.h" +#include "TSSSDPhysics.h" +#include "TPlasticPhysics.h" // Use CLHEP System of unit and Physical Constant #include "CLHEP/Units/GlobalSystemOfUnits.h" diff --git a/NPAnalysis/10He_Riken/src/Analysis.cc b/NPAnalysis/10He_Riken/src/Analysis.cc index 05f7423987acdf687ead3e2d4d5c63eb2095a398..fff2be80b9eface95fc334174485f0490c498e9a 100644 --- a/NPAnalysis/10He_Riken/src/Analysis.cc +++ b/NPAnalysis/10He_Riken/src/Analysis.cc @@ -24,64 +24,50 @@ int main(int argc,char** argv) // Instantiate some Reaction NPL::Reaction* He10Reaction = new Reaction ; - He10Reaction -> ReadConfigurationFile("10He.reaction") ; + He10Reaction -> ReadConfigurationFile("10He.reaction") ; NPL::Reaction* Li10Reaction = new Reaction ; Li10Reaction -> ReadConfigurationFile("9Li-dp-10Li.reaction") ; - - cout << "!!!!" << endl; // Instantiate the detector using a file DetectorManager* myDetector = new DetectorManager ; myDetector -> ReadConfigurationFile(detectorfileName) ; - cout << "JJJJ"<< endl ; + // Instantiate the Calibration Manger using a file CalibrationManager* myCalibration = new CalibrationManager(calibrationfileName) ; // Attach more branch to the output double ELab[2], ExcitationEnergy[2] ; - double ThetaLab[2] , ThetaCM[2] ; - double X[2] , Y[2] ; - double EPl1[2], EPl2[2] ; - double ThinSi_E ; + double ThetaLab[2] , ThetaCM[2] ; + double X[2] , Y[2] ; + // Exitation Energy RootOutput::getInstance()->GetTree()->Branch("ExcitationEnergy",ExcitationEnergy,"ExcitationEnergy[2]/D") ; //E lab et Theta lab - RootOutput::getInstance()->GetTree()->Branch("ELab",ELab,"ELab[2]/D") ; - RootOutput::getInstance()->GetTree()->Branch("ThetaLab",ThetaLab,"ThetaLab[2]/D") ; - RootOutput::getInstance()->GetTree()->Branch("ThinSi_E",&ThinSi_E,"ThinSi_E/D") ; - - RootOutput::getInstance()->GetTree()->Branch("X",X,"X/D[2]") ; - RootOutput::getInstance()->GetTree()->Branch("Y",Y,"Y/D[2]") ; + RootOutput::getInstance()->GetTree()->Branch("ThetaCM",ThetaCM,"ThetaCM[2]/D") ; + RootOutput::getInstance()->GetTree()->Branch("ELab",ELab,"ELab[2]/D") ; + RootOutput::getInstance()->GetTree()->Branch("X",X,"X/D[2]") ; + RootOutput::getInstance()->GetTree()->Branch("Y",Y,"Y/D[2]") ; - RootOutput::getInstance()->GetTree()->Branch("ThetaCM",ThetaCM,"ThetaCM[2]/D") ; - - RootOutput::getInstance()->GetTree()->Branch("Plastic1_Energy",EPl1,"EPl[2]/D") ; - RootOutput::getInstance()->GetTree()->Branch("Plastic2_Energy",EPl2,"DEPl[2]/D") ; // Get the formed Chained Tree and Treat it TChain* Chain = RootInput:: getInstance() -> GetChain() ; // Open the ThinSi Branch - Chain->SetBranchStatus("ThinSiEnergy",true) ; Chain->SetBranchStatus("InitialConditions",true) ; Chain->SetBranchStatus("fIC_*",true) ; - Chain->SetBranchStatus("fPlastic_*",true); TInitialConditions* Init = new TInitialConditions(); - Chain->SetBranchAddress("ThinSiEnergy" ,&ThinSi_E ); Chain->SetBranchAddress("InitialConditions" ,&Init ); - TPlasticData* Plastic = new TPlasticData() ; - Chain->SetBranchAddress("Plastic",&Plastic ); - double XTarget=0 ; double YTarget=0; double BeamTheta = 0 ; double BeamPhi = 0 ; double E=-1000; - // Get Must2 Pointer: -// MUST2Array* M2 = (MUST2Array*) myDetector -> m_Detector["MUST2"] ; - // Allow directe acces to MUST2 Physics event + // Get Detector Pointer: + TMust2Physics* M2 = (TMust2Physics*) myDetector -> m_Detector["MUST2"] ; + TPlasticPhysics* Pl = (TPlasticPhysics*) myDetector -> m_Detector["Plastic"] ; + TSSSDPhysics* ThinSi = (TSSSDPhysics*) myDetector -> m_Detector["SSSD"] ; cout << " ///////// Starting Analysis ///////// "<< endl << endl ; int i ,N=Chain -> GetEntries(); @@ -97,8 +83,6 @@ int main(int argc,char** argv) { ELab[hh] = -1 ; ExcitationEnergy[hh] = -1 ; ThetaLab[hh] = -1 ; X[hh] = -1000 ; Y[hh] = -1000 ; ThetaCM[hh] = -1 ; - EPl1[hh] = 0 ; EPl2[hh] = 0 ; - ThinSi_E = -1 ; } // Minimum code @@ -123,8 +107,6 @@ int main(int argc,char** argv) myDetector -> BuildPhysicalEvent() ; //// - - /* // Target (from initial condition) XTarget = Init->GetICPositionX(0); YTarget = Init->GetICPositionY(0); diff --git a/NPAnalysis/10He_Riken/src/DetectorManager.cc b/NPAnalysis/10He_Riken/src/DetectorManager.cc index 9141ba79d6956dfbf013c758f59eed336678b340..49447f19abc5453ebf3dbf3898089d01e681ca37 100644 --- a/NPAnalysis/10He_Riken/src/DetectorManager.cc +++ b/NPAnalysis/10He_Riken/src/DetectorManager.cc @@ -7,6 +7,8 @@ // Detector #include "TMust2Physics.h" +#include "TSSSDPhysics.h" +#include "TPlasticPhysics.h" ///////////////////////////////////////////////////////////////////////////////////////////////// // Default Constructor and Destructor DetectorManager::DetectorManager() @@ -26,10 +28,11 @@ void DetectorManager::ReadConfigurationFile(string Path) string DataBuffer; /////////Boolean//////////////////// - bool MUST2 = false ; - bool AddThinSi = false ; - bool GeneralTarget = false ; - bool GPDTracker = false ; // Gaspard Tracker + bool MUST2 = false ; + bool AddThinSi = false ; + bool ScintillatorPlastic = false ; + bool GeneralTarget = false ; + bool GPDTracker = false ; // Gaspard Tracker ////////////////////////////////////////////////////////////////////////////////////////// // added by Nicolas [07/05/09] string GlobalPath = getenv("NPTOOL"); @@ -52,7 +55,7 @@ void DetectorManager::ReadConfigurationFile(string Path) while (!ConfigFile.eof()) { //Pick-up next line - getline(ConfigFile, LineBuffer); + getline(ConfigFile, LineBuffer);cout << LineBuffer<<endl; //Search for comment Symbol: % if (LineBuffer.compare(0, 1, "%") == 0) { /*Do Nothing*/ ;} @@ -94,15 +97,15 @@ void DetectorManager::ReadConfigurationFile(string Path) AddDetector("MUST2" , myDetector) ; } - /* //////////////////////////////////////////// - ////////// Search for Add.ThinSi /////////// + //////////////////////////////////////////// + ////////// Search for ThinSi (SSSD)///////// //////////////////////////////////////////// else if (LineBuffer.compare(0, 9, "AddThinSi") == 0 && AddThinSi == false) { AddThinSi = true ; cout << "//////// Thin Si ////////" << endl << endl ; // Instantiate the new array as a VDetector Object - VDetector* myDetector = new ThinSi() ; + VDetector* myDetector = new TSSSDPhysics() ; // Read Position of Telescope ConfigFile.close() ; @@ -110,10 +113,29 @@ void DetectorManager::ReadConfigurationFile(string Path) ConfigFile.open(Path.c_str()) ; // Add array to the VDetector Vector - AddDetector(myDetector) ; + AddDetector("SSSD",myDetector) ; } - + + + //////////////////////////////////////////// + ///////////// Search for Plastic /////////// //////////////////////////////////////////// + else if (LineBuffer.compare(0, 19, "ScintillatorPlastic") == 0 && ScintillatorPlastic == false) { + ScintillatorPlastic = true ; + cout << "//////// Plastic ////////" << endl << endl ; + + // Instantiate the new array as a VDetector Object + VDetector* myDetector = new TPlasticPhysics() ; + // Read Position of Telescope + ConfigFile.close() ; + myDetector->ReadConfiguration(Path) ; + ConfigFile.open(Path.c_str()) ; + + // Add array to the VDetector Vector + AddDetector("Plastic",myDetector) ; + } + + /* //////////////////////////////////////////// //////////// Search for Target ///////////// //////////////////////////////////////////// @@ -200,7 +222,7 @@ void DetectorManager::InitializeRootOutput() void DetectorManager::AddDetector(string DetectorName , VDetector* newDetector) { - m_Detector["MUST2"] = newDetector ; + m_Detector[DetectorName] = newDetector ; } ///////////////////////////////////////////////////////////////////////////////////////////////// void DetectorManager::ClearEventPhysics() diff --git a/NPAnalysis/10He_Riken/src/GNUmakefile b/NPAnalysis/10He_Riken/src/GNUmakefile index a5a252fca5963eca3ae3130213132d68ad709eeb..8241a5d3adecbc7f45413fd8667f6645dac119e0 100644 --- a/NPAnalysis/10He_Riken/src/GNUmakefile +++ b/NPAnalysis/10He_Riken/src/GNUmakefile @@ -18,7 +18,9 @@ CXXFLAGS += -I$(NPLIB)/include LDFLAGS = `root-config --libs` -lMathMore LDFLAGS+= -L$(NPLIB)/lib -lCalibrationManager -lVDetector -lIORoot -lReaction -lEnergyLoss \ -lMust2Data -lMust2Physics \ - -lAnnularS1Data -lGaspardData -lPlasticData\ + -lAnnularS1Data -lGaspardData \ + -lPlasticData -lPlasticPhysics \ + -lSSSDData -lSSSDPhysics \ -lInitialConditions -lInteractionCoordinates LDFLAGS+= -L$(CLHEP_LIB_DIR) -l$(CLHEP_LIB) diff --git a/NPLib/Plastic/Makefile b/NPLib/Plastic/Makefile index e5373baed1a56beac4a2ecd424d8ed5a91a45d6d..06fc2ee6055f821118bbba183e20029e06d11969 100644 --- a/NPLib/Plastic/Makefile +++ b/NPLib/Plastic/Makefile @@ -268,7 +268,7 @@ GLIBS = $(ROOTGLIBS) $(SYSLIBS) INCLUDE = -I$(CLHEP_BASE_DIR)/include #------------------------------------------------------------------------------ -SHARELIB = libPlasticData.so +SHARELIB = libPlasticData.so libPlasticPhysics.so all: $(SHARELIB) #------------------------------------------------------------------------------ @@ -281,8 +281,15 @@ libPlasticData.so: TPlasticData.o TPlasticDataDict.o TPlasticDataDict.cxx: TPlasticData.h rootcint -f $@ -c $^ +libPlasticPhysics.so: TPlasticPhysics.o TPlasticPhysicsDict.o + $(LD) $(SOFLAGS) $^ $(OutPutOpt) $@ + +TPlasticPhysicsDict.cxx: TPlasticPhysics.h + rootcint -f $@ -c $^ + # dependances TPlasticData.o: TPlasticData.cxx TPlasticData.h +TPlasticPhysics.o: TPlasticPhysics.cxx TPlasticPhysics.h ####################################### ############# Clean and More ########## diff --git a/NPLib/Plastic/TPlasticData.h b/NPLib/Plastic/TPlasticData.h index 5c32fea629cc2b0cc27dd34fad893d0a938e486e..ebd2eb3f79c1ca83b7710a75c8f26ac949d7bb1e 100644 --- a/NPLib/Plastic/TPlasticData.h +++ b/NPLib/Plastic/TPlasticData.h @@ -12,7 +12,7 @@ class TPlasticData : public TObject { // ADC vector<double> fPlastic_Energy ; vector<double> fPlastic_Time ; - vector<short> fPlastic_Number ; + vector<short> fPlastic_Number ; public: TPlasticData(); @@ -24,25 +24,25 @@ class TPlasticData : public TObject { ///////////////////// GETTERS //////////////////////// // (E) - double GetEnergy(int i) {return fPlastic_Energy[i];} + double GetEnergy(int i) { return fPlastic_Energy[i] ;} // (T) - double GetTime(int i) {return fPlastic_Time[i];} + double GetTime(int i) { return fPlastic_Time[i] ;} // (N) - int GetPlasticNumber(int i) {return fPlastic_Number[i];} + int GetPlasticNumber(int i) { return fPlastic_Number[i] ;} - - double GetEnergySize() {return fPlastic_Energy.size();} + //Mult + // E + double GetEnergyMult() { return fPlastic_Energy.size() ;} // (T) - double GetTimeSize() {return fPlastic_Time.size();} + double GetTimeMult() { return fPlastic_Time.size() ;} // (N) - int GetPlasticNumberSize() {return fPlastic_Number.size();} - + int GetPlasticNumberMult() { return fPlastic_Number.size() ;} ///////////////////// SETTERS //////////////////////// // (E) - void SetEnergy(double E) {fPlastic_Energy.push_back(E);} - void SetTime(double T) {fPlastic_Time.push_back(T);} - void SetPlasticNumber(int N) {fPlastic_Number.push_back(N);} + void SetEnergy(double E) { fPlastic_Energy.push_back(E) ;} + void SetTime(double T) { fPlastic_Time.push_back(T) ;} + void SetPlasticNumber(int N) { fPlastic_Number.push_back(N) ;} // ClassDef(TPlasticData,1) // PlasticData structure diff --git a/NPLib/Plastic/TPlasticPhysics.cxx b/NPLib/Plastic/TPlasticPhysics.cxx new file mode 100644 index 0000000000000000000000000000000000000000..00ddd0bcf7cb5a0efefb39ca6cacb2004ab44119 --- /dev/null +++ b/NPLib/Plastic/TPlasticPhysics.cxx @@ -0,0 +1,257 @@ +/***************************************************************************** + * Copyright (C) 2009 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: Adrien MATTA contact address: matta@ipno.in2p3.fr * + * * + * Creation Date : november 2009 * + * Last update : * + *---------------------------------------------------------------------------* + * Decription: * + * This class hold Plastic Physics * + * * + *---------------------------------------------------------------------------* + * Comment: * + * * + * * + *****************************************************************************/ + +// NPL +#include "TPlasticPhysics.h" +#include "../include/RootOutput.h" +#include "../include/RootInput.h" + +// STL +#include <iostream> +#include <sstream> +#include <fstream> +#include <limits> +#include <stdlib.h> +using namespace std; + +// ROOT +#include "TChain.h" + +// tranform an integer to a string + string itoa(int value) + { + std::ostringstream o; + + if (!(o << value)) + return "" ; + + return o.str(); + } + +ClassImp(TPlasticPhysics) +/////////////////////////////////////////////////////////////////////////// +TPlasticPhysics::TPlasticPhysics() + { + NumberOfDetector = 0 ; + EventData = new TPlasticData ; + EventPhysics = this ; + } + +/////////////////////////////////////////////////////////////////////////// +TPlasticPhysics::~TPlasticPhysics() + {} + +/////////////////////////////////////////////////////////////////////////// +void TPlasticPhysics::Clear() + { + DetectorNumber .clear() ; + StripNumber .clear() ; + Energy .clear() ; + Time .clear() ; + } + +/////////////////////////////////////////////////////////////////////////// +void TPlasticPhysics::ReadConfiguration(string Path) + { + ifstream ConfigFile ; + ConfigFile.open(Path.c_str()) ; + string LineBuffer ; + string DataBuffer ; + + double Theta = 0 , Phi = 0 , R = 0 , Thickness = 0 , Radius = 0 , LeadThickness = 0; + string Scintillator ; + + bool check_Theta = false ; + bool check_Phi = false ; + bool check_R = false ; + bool check_Thickness = false ; + bool check_Radius = false ; + bool check_LeadThickness = false ; + bool check_Scintillator = false ; + bool ReadingStatus = false ; + + + while (!ConfigFile.eof()) + { + + getline(ConfigFile, LineBuffer); + + // If line is a Start Up Plastic bloc, Reading toggle to true + if (LineBuffer.compare(0, 7, "Plastic") == 0) + { + cout << "///" << endl ; + cout << "Platic found: " << endl ; + ReadingStatus = true ; + + } + + // Else don't toggle to Reading Block Status + else ReadingStatus = false ; + + // Reading Block + while(ReadingStatus) + { + // Pickup Next Word + ConfigFile >> DataBuffer ; + + // Comment Line + if (DataBuffer.compare(0, 1, "%") == 0) { ConfigFile.ignore ( std::numeric_limits<std::streamsize>::max(), '\n' );} + + // Finding another telescope (safety), toggle out + else if (DataBuffer.compare(0, 6, "Plastic") == 0) { + cout << "WARNING: Another Telescope is find before standard sequence of Token, Error may occured in Telecope definition" << endl ; + ReadingStatus = false ; + } + + //Angle method + else if (DataBuffer.compare(0, 6, "THETA=") == 0) { + check_Theta = true; + ConfigFile >> DataBuffer ; + Theta = atof(DataBuffer.c_str()) ; + } + + else if (DataBuffer.compare(0, 4, "PHI=") == 0) { + check_Phi = true; + ConfigFile >> DataBuffer ; + Phi = atof(DataBuffer.c_str()) ; + } + + else if (DataBuffer.compare(0, 2, "R=") == 0) { + check_R = true; + ConfigFile >> DataBuffer ; + R = atof(DataBuffer.c_str()) ; + } + + else if (DataBuffer.compare(0, 7, "Radius=") == 0) { + check_Radius = true; + ConfigFile >> DataBuffer ; + Radius = atof(DataBuffer.c_str()) ; + } + + else if (DataBuffer.compare(0, 10, "Thickness=") == 0) { + check_Thickness = true; + ConfigFile >> DataBuffer ; + Thickness = atof(DataBuffer.c_str()) ; + } + + else if (DataBuffer.compare(0, 13, "Scintillator=") == 0) { + check_Scintillator = true ; + ConfigFile >> DataBuffer ; + Scintillator = DataBuffer ; + } + + else if (DataBuffer.compare(0, 14, "LeadThickness=") == 0) { + check_LeadThickness = true; + ConfigFile >> DataBuffer ; + LeadThickness = atof(DataBuffer.c_str()) ; + } + + /////////////////////////////////////////////////// + // If no Detector Token and no comment, toggle out + else + {ReadingStatus = false; cout << "Wrong Token Sequence: Getting out " << DataBuffer << endl ;} + + ///////////////////////////////////////////////// + // If All necessary information there, toggle out + + if ( check_Theta && check_Phi && check_R && check_Thickness && check_Radius && check_LeadThickness && check_Scintillator) + { + NumberOfDetector++; + + // Reinitialisation of Check Boolean + + check_Theta = false ; + check_Phi = false ; + check_R = false ; + check_Thickness = false ; + check_Radius = false ; + check_LeadThickness = false ; + check_Scintillator = false ; + ReadingStatus = false ; + cout << "///"<< endl ; + } + + } + } + } + + +/////////////////////////////////////////////////////////////////////////// +void TPlasticPhysics::AddParameterToCalibrationManager() + { + CalibrationManager* Cal = CalibrationManager::getInstance(); + + for(int i = 0 ; i < NumberOfDetector ; i++) + { + for( int j = 0 ; j < 16 ; j++) + { + Cal->AddParameter("Plastic", "Detector"+itoa(i+1)+"_E","Plastic_Detector"+itoa(i+1)+"_E") ; + Cal->AddParameter("Plastic", "Detector"+itoa(i+1)+"_T","Plastic_Detector"+itoa(i+1)+"_T") ; + } + + } + } + +/////////////////////////////////////////////////////////////////////////// +void TPlasticPhysics::InitializeRootInput() + { + TChain* inputChain = RootInput::getInstance()->GetChain() ; + inputChain->SetBranchStatus ( "Plastic" , true ) ; + inputChain->SetBranchStatus ( "fPlastic_*" , true ) ; + inputChain->SetBranchAddress( "Plastic" , &EventData ) ; + } + +/////////////////////////////////////////////////////////////////////////// +void TPlasticPhysics::InitializeRootOutput() + { + TTree* outputTree = RootOutput::getInstance()->GetTree() ; + outputTree->Branch( "Plastic" , "TPlasticPhysics" , &EventPhysics ) ; + } + +/////////////////////////////////////////////////////////////////////////// +void TPlasticPhysics::BuildPhysicalEvent() + { + BuildSimplePhysicalEvent() ; + } + +/////////////////////////////////////////////////////////////////////////// +void TPlasticPhysics::BuildSimplePhysicalEvent() + { + for(unsigned int i = 0 ; i < EventData->GetEnergyMult() ; i++) + { + + DetectorNumber .push_back( EventData->GetPlasticNumber(i) ) ; + StripNumber .push_back( EventData->GetPlasticNumber(i) ) ; + + Energy .push_back( + CalibrationManager::getInstance()->ApplyCalibration( "Plastic/Detector" + itoa( EventData->GetPlasticNumber(i) ) +"_E", + EventData->GetEnergy(i) ) + ) ; + + Time .push_back( + CalibrationManager::getInstance()->ApplyCalibration( "Plastic/Detector" + itoa( EventData->GetPlasticNumber(i) ) +"_T", + EventData->GetTime(i) ) + ) ; + } + + } + diff --git a/NPLib/Plastic/TPlasticPhysics.h b/NPLib/Plastic/TPlasticPhysics.h new file mode 100644 index 0000000000000000000000000000000000000000..f1eedb765f96dee90100814473df8c6993fbc5fe --- /dev/null +++ b/NPLib/Plastic/TPlasticPhysics.h @@ -0,0 +1,92 @@ +#ifndef __PlasticPhysics__ +#define __PlasticPhysics__ +/***************************************************************************** + * Copyright (C) 2009 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: Adrien MATTA contact address: matta@ipno.in2p3.fr * + * * + * Creation Date : November 2009 * + * Last update : * + *---------------------------------------------------------------------------* + * Decription: * + * This class hold thePlastic Detector Physics * + * * + *---------------------------------------------------------------------------* + * Comment: * + * * + * * + *****************************************************************************/ + +// STL +#include <vector> +using namespace std ; + +// ROOT +#include "TObject.h" + +// NPL +#include "TPlasticData.h" +#include "../include/VDetector.h" +#include "../include/CalibrationManager.h" + +class TPlasticPhysics : public TObject, public NPA::VDetector +{ + public: // Constructor and Destructor + TPlasticPhysics(); + ~TPlasticPhysics(); + + public: // Calibrated Data + + vector<UShort_t> DetectorNumber ; + vector<UShort_t> StripNumber ; + vector<Double_t> Energy ; + vector<Double_t> Time ; + + public: // inherrited from VDetector + // Read stream at ConfigFile to pick-up parameters of detector (Position,...) using Token + void ReadConfiguration(string) ; + + + // Add Parameter to the CalibrationManger + void AddParameterToCalibrationManager() ; + + + // 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. Aime 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() {Clear();} + void ClearEventData() {EventData->Clear();} + + private: // Data not writted in the tree + int NumberOfDetector ;//! + TPlasticData* EventData ;//! + TPlasticPhysics* EventPhysics ;//! + + void Clear(); + void Clear(const Option_t*) {}; + + ClassDef(TPlasticPhysics,1) // PlasticPhysics structure +}; + +#endif diff --git a/NPLib/SSSD/TSSSDPhysics.cxx b/NPLib/SSSD/TSSSDPhysics.cxx index 2a36bb387cfd5014d97861d4b75a3d37939f990b..63be1855e636503767ddc451f875d8821984c922 100644 --- a/NPLib/SSSD/TSSSDPhysics.cxx +++ b/NPLib/SSSD/TSSSDPhysics.cxx @@ -50,8 +50,8 @@ ClassImp(TSSSDPhysics) /////////////////////////////////////////////////////////////////////////// TSSSDPhysics::TSSSDPhysics() { - NumberOfDetector = 0 ; - EventData = new TSSSDData ; + NumberOfDetector = 0 ; + EventData = new TSSSDData ; EventPhysics = this ; } /////////////////////////////////////////////////////////////////////////// @@ -74,7 +74,7 @@ void TSSSDPhysics::ReadConfiguration(string Path) string DataBuffer ; double TLX , BLX , BRX , TRX , TLY , BLY , BRY , TRY , TLZ , BLZ , BRZ , TRZ ; - double Theta = 0 , Phi = 0 , R = 0 , beta_u = 0 , beta_v = 0 , beta_w = 0 ; + double Theta = 0 , Phi = 0 , R = 0 , beta_u = 0 , beta_v = 0 , beta_w = 0 ; bool check_A = false ; bool check_B = false ; bool check_C = false ; @@ -94,11 +94,9 @@ void TSSSDPhysics::ReadConfiguration(string Path) // If line is a Start Up ThinSi bloc, Reading toggle to true if (LineBuffer.compare(0, 6, "ThinSi") == 0) { - cout << "///" << endl ; - cout << "Detector found: " << endl ; - ReadingStatus = true ; - - } + cout << "Detector found: " << endl ; + ReadingStatus = true ; + } // Else don't toggle to Reading Block Status else ReadingStatus = false ; @@ -260,7 +258,7 @@ void TSSSDPhysics::InitializeRootInput() { TChain* inputChain = RootInput::getInstance()->GetChain() ; inputChain->SetBranchStatus ( "ThinSi" , true ) ; - inputChain->SetBranchStatus ( "ThinSi_*" , true ) ; + inputChain->SetBranchStatus ( "fSSSD_*" , true ) ; inputChain->SetBranchAddress( "ThinSi" , &EventData ) ; } diff --git a/NPLib/SSSD/TSSSDPhysics.h b/NPLib/SSSD/TSSSDPhysics.h index 2663cf392e49fa404cf022496cce96214aeefe4d..21bc790fb7067a44b6beef2e3f1da94890a10b97 100644 --- a/NPLib/SSSD/TSSSDPhysics.h +++ b/NPLib/SSSD/TSSSDPhysics.h @@ -35,6 +35,10 @@ using namespace std ; class TSSSDPhysics : public TObject, public NPA::VDetector { + public: // Constructor and Destructor + TSSSDPhysics(); + ~TSSSDPhysics(); + public: // Calibrated Data @@ -74,10 +78,6 @@ class TSSSDPhysics : public TObject, public NPA::VDetector void ClearEventPhysics() {Clear();} void ClearEventData() {EventData->Clear();} - public: - TSSSDPhysics(); - virtual ~TSSSDPhysics(); - private: // Data not writted in the tree int NumberOfDetector ;//! TSSSDData* EventData ;//!