Skip to content
Snippets Groups Projects
Commit a2a5544a authored by LAVIRON Adrien's avatar LAVIRON Adrien
Browse files

feature: Reset counter is now available in TComptonTelescopePhysics

refactor: options in online_coinc.cpp
parent 547207a9
No related branches found
No related tags found
No related merge requests found
...@@ -64,6 +64,8 @@ class TComptonTelescopeData : public TObject { ...@@ -64,6 +64,8 @@ class TComptonTelescopeData : public TObject {
vector<UShort_t> fCT_Calorimeter_T_ChannelNbr; vector<UShort_t> fCT_Calorimeter_T_ChannelNbr;
vector<Double_t> fCT_Calorimeter_T_Time; vector<Double_t> fCT_Calorimeter_T_Time;
long int fCTResetCount;
public: public:
TComptonTelescopeData(); TComptonTelescopeData();
virtual ~TComptonTelescopeData(); virtual ~TComptonTelescopeData();
...@@ -136,6 +138,8 @@ class TComptonTelescopeData : public TObject { ...@@ -136,6 +138,8 @@ class TComptonTelescopeData : public TObject {
void SetCTCalorimeterTChannelNbr(const UShort_t ChannelNbr) {fCT_Calorimeter_T_ChannelNbr.push_back(ChannelNbr);} void SetCTCalorimeterTChannelNbr(const UShort_t ChannelNbr) {fCT_Calorimeter_T_ChannelNbr.push_back(ChannelNbr);}
void SetCTCalorimeterTTime(const Double_t Time) {fCT_Calorimeter_T_Time.push_back(Time);}*/ void SetCTCalorimeterTTime(const Double_t Time) {fCT_Calorimeter_T_Time.push_back(Time);}*/
void SetResetCount(long int reset) {fCTResetCount = reset;}
///////////////////// GETTERS //////////////////////// ///////////////////// GETTERS ////////////////////////
// DSSD // DSSD
...@@ -179,6 +183,8 @@ class TComptonTelescopeData : public TObject { ...@@ -179,6 +183,8 @@ class TComptonTelescopeData : public TObject {
UShort_t GetCTCalorimeterTChannelNbr(const Int_t i) const {return fCT_Calorimeter_T_ChannelNbr[i];} UShort_t GetCTCalorimeterTChannelNbr(const Int_t i) const {return fCT_Calorimeter_T_ChannelNbr[i];}
Double_t GetCTCalorimeterTTime(const Int_t i) const {return fCT_Calorimeter_T_Time[i];} Double_t GetCTCalorimeterTTime(const Int_t i) const {return fCT_Calorimeter_T_Time[i];}
long int GetResetCount() const {return fCTResetCount;}
ClassDef(TComptonTelescopeData,1) // ComptonTelescopeData structure ClassDef(TComptonTelescopeData,1) // ComptonTelescopeData structure
}; };
......
...@@ -273,6 +273,7 @@ void TComptonTelescopePhysics::BuildSimplePhysicalEvent() ...@@ -273,6 +273,7 @@ void TComptonTelescopePhysics::BuildSimplePhysicalEvent()
} }
} }
} }
resetCount = m_EventData -> GetResetCount();
// if (DetectorNumber.size() == 1) return; // if (DetectorNumber.size() == 1) return;
} }
...@@ -370,6 +371,8 @@ void TComptonTelescopePhysics::PreTreat() ...@@ -370,6 +371,8 @@ void TComptonTelescopePhysics::PreTreat()
m_PreTreatedData -> SetCTCalorimeter(m_EventData->GetCTCalorimeterTTowerNbr(i), m_EventData->GetCTCalorimeterEDetectorNbr(i*m_NPixels), m_EventData->GetCTCalorimeterTChannelNbr(i), m_EventData->GetCTCalorimeterTTime(i), data, m_NPixels); m_PreTreatedData -> SetCTCalorimeter(m_EventData->GetCTCalorimeterTTowerNbr(i), m_EventData->GetCTCalorimeterEDetectorNbr(i*m_NPixels), m_EventData->GetCTCalorimeterTChannelNbr(i), m_EventData->GetCTCalorimeterTTime(i), data, m_NPixels);
} }
m_PreTreatedData -> SetResetCount(m_EventData -> GetResetCount());
} }
......
...@@ -74,6 +74,7 @@ class TComptonTelescopePhysics : public TObject, public NPL::VDetector ...@@ -74,6 +74,7 @@ class TComptonTelescopePhysics : public TObject, public NPL::VDetector
multimap<int, vector<int>> CalorData; multimap<int, vector<int>> CalorData;
// Both // Both
vector<int> deltaT; vector<int> deltaT;
long int resetCount;
......
...@@ -17,13 +17,16 @@ ...@@ -17,13 +17,16 @@
#include "DecodeT.h" #include "DecodeT.h"
#define __TEST_ZONE__ #define __TEST_ZONE__
#undef __TEST_ZONE__ //#undef __TEST_ZONE__
#define __CIRCULAR_TREE__
#undef __CIRCULAR_TREE__
#define __USE_CUTG__ #define __USE_CUTG__
//#undef __USE_CUTG__ #undef __USE_CUTG__
#define __RESET_SEARCH__ #define __RESET_SEARCH__
#undef __RESET_SEARCH__ //#undef __RESET_SEARCH__
// C++ headers // C++ headers
#include <iostream> #include <iostream>
...@@ -86,13 +89,17 @@ void setCTTracker(TComptonTelescopeData* ccamData, newframe_t* event, vector<int ...@@ -86,13 +89,17 @@ void setCTTracker(TComptonTelescopeData* ccamData, newframe_t* event, vector<int
//--//--//--//--//--//--//--//--//--//--//--//--//--//--//--// //--//--//--//--//--//--//--//--//--//--//--//--//--//--//--//
int main() int main()
{ {
#ifdef __RESET_SEARCH__ #if defined __RESET_SEARCH__
int resetCountSearch = 3; int resetCountSearch = 3;
int timestampDiffSearch = 1000; int timestampDiffSearch = 500;
int timestampNBins = 100; int timestampNBins = 100;
auto fout = new TFile("pipo.root", "recreate"); auto fout = new TFile("pipo.root", "recreate");
auto bidim = new TH2F("bidim", "bidim", auto bidim = new TH2F("bidim", "bidim",
2*resetCountSearch, -resetCountSearch, resetCountSearch, #ifdef __TEST_ZONE__
150, 0, 150000,
#else
2*resetCountSearch+1, -resetCountSearch-.5, resetCountSearch+.5,
#endif
timestampNBins, -timestampDiffSearch, timestampDiffSearch); timestampNBins, -timestampDiffSearch, timestampDiffSearch);
#endif #endif
#ifdef __USE_CUTG__ #ifdef __USE_CUTG__
...@@ -118,7 +125,7 @@ int main() ...@@ -118,7 +125,7 @@ int main()
/////////////////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////////////////
// configure option manager // configure option manager
// NPOptionManager::getInstance()->Destroy(); // NPOptionManager::getInstance()->Destroy();
#ifdef __TEST_ZONE__ #ifdef __CIRCULAR_TREE__
string arg = "-D ./ComptonCAM.detector -C calibrations.txt -GH -E ./10He.reaction --circular"; string arg = "-D ./ComptonCAM.detector -C calibrations.txt -GH -E ./10He.reaction --circular";
#else #else
string arg = "-D ./ComptonCAM.detector -C calibrations.txt -GH -E ./10He.reaction"; string arg = "-D ./ComptonCAM.detector -C calibrations.txt -GH -E ./10He.reaction";
...@@ -165,7 +172,7 @@ int main() ...@@ -165,7 +172,7 @@ int main()
const int pixelNumber = 64; const int pixelNumber = 64;
const int stripNumber = 32; const int stripNumber = 32;
#ifdef __TEST_ZONE__ #ifdef __CIRCULAR_TREE__
while (DD -> getCursor() < dlen) while (DD -> getCursor() < dlen)
{ {
...@@ -220,7 +227,7 @@ int main() ...@@ -220,7 +227,7 @@ int main()
resetCount = DT->getResetCount() - resetCount; resetCount = DT->getResetCount() - resetCount;
cout << "Found reset count: " << resetCount << endl; cout << "Found reset count: " << resetCount << endl;
#ifdef __RESET_SEARCH__ #if defined __RESET_SEARCH__ && !defined __TEST_ZONE__
// Fill control bidim // Fill control bidim
for (int reset=-resetCountSearch; reset<resetCountSearch+1; reset++) for (int reset=-resetCountSearch; reset<resetCountSearch+1; reset++)
{ {
...@@ -241,23 +248,29 @@ int main() ...@@ -241,23 +248,29 @@ int main()
int tr = DR -> getTime(); int tr = DR -> getTime();
int td = DD -> getTime(); int td = DD -> getTime();
// int dt = 100; // int dt = 100;
#ifdef __RESET_SEARCH__ #if defined __RESET_SEARCH__
while(DR -> getCursor() < rlen and DD -> getCursor() < dlen) while(DR -> getCursor() < rlen and DD -> getCursor() < dlen)
//while(c < 1000) // while(c < 1000)
{ {
// cout << DR -> getTime() << " " << DD -> getTime() << endl; // cout << DR -> getTime() << " " << DD -> getTime() << endl;
if (cr == cd) { if (cr == cd) {
if (abs(td-tr) < timestampDiffSearch) { if (abs(td-tr) < timestampDiffSearch) {
#ifdef __TEST_ZONE__
bidim->Fill(c, td-tr);
#else
bidim->Fill(reset, td-tr); bidim->Fill(reset, td-tr);
#endif
c++; c++;
} }
#else #else
while(DR -> getCursor() < rlen and DD -> getCursor() < dlen) while(DR -> getCursor() < rlen and DD -> getCursor() < dlen)
{ {
if (cr == cd) { if (cr == cd) {
#ifndef __TEST_ZONE__
if (td-tr < 110 and td-tr > 0) { // That one is the real one if (td-tr > 0 and td-tr < 110) { // That one is the real one
// if (tr-td > 50 and tr-td < 1000) { #else
if (td-tr > -1000 and td-tr < 1000) {
#endif
//DR -> Dump(); //DR -> Dump();
//DD -> Dump(); //DD -> Dump();
c++; c++;
...@@ -269,6 +282,7 @@ int main() ...@@ -269,6 +282,7 @@ int main()
// Fill data // Fill data
ccamData -> SetCTCalorimeter(1, 4, DR->getPixelNumber(), DR->getTime(), DR->getData(), pixelNumber); ccamData -> SetCTCalorimeter(1, 4, DR->getPixelNumber(), DR->getTime(), DR->getData(), pixelNumber);
setCTTracker(ccamData, DD -> getEvent(), &nb_asic, &chain, stripNumber); setCTTracker(ccamData, DD -> getEvent(), &nb_asic, &chain, stripNumber);
ccamData -> SetResetCount(cr);
// Build physical event // Build physical event
m_NPDetectorManager->BuildPhysicalEvent(); m_NPDetectorManager->BuildPhysicalEvent();
...@@ -315,7 +329,7 @@ int main() ...@@ -315,7 +329,7 @@ int main()
i++; i++;
} // End of main loop } // End of main loop
#ifdef __RESET_SEARCH__ #if defined __RESET_SEARCH__ && !defined __TEST_ZONE__
} }
#endif #endif
...@@ -329,7 +343,7 @@ int main() ...@@ -329,7 +343,7 @@ int main()
// fill spectra // fill spectra
m_NPDetectorManager -> WriteSpectra(); m_NPDetectorManager -> WriteSpectra();
#ifdef __RESET_SEARCH__ #if defined __RESET_SEARCH__ || defined __
fout->cd(); fout->cd();
bidim->Write(); bidim->Write();
fout->Close(); fout->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