Skip to content
Snippets Groups Projects
Commit da00c943 authored by matta's avatar matta
Browse files

* removing fs2pc stuff from NPL

- Sharc Tigress and Trifoil are now stand alone, no mixeup with the Unpacker (Triumf code) needs
parent bdb943bc
No related branches found
No related tags found
No related merge requests found
...@@ -93,218 +93,4 @@ void TSharcData::Dump() const ...@@ -93,218 +93,4 @@ void TSharcData::Dump() const
<< " Time LED: " << fSharc_PAD_TimeLED[i] << endl; << " Time LED: " << fSharc_PAD_TimeLED[i] << endl;
} }
}
/////////////////////////
void TSharcData::ReadFSPCFile(string FSPCPath){
ifstream FSPCFile;
FSPCFile.open(FSPCPath.c_str());
if(!FSPCFile.is_open()) {cout << "Error: FSPC File: " << FSPCPath << " not found " << endl ; exit(1);}
else {cout << "Sharc is Reading FSPC file : " << FSPCPath << endl ;}
string LineBuffer;
string DataBuffer;
string DetectorName;
string FrontBack;
string ChannelNumberStr;
int ChannelNumber;
int StripNumber;
while(!FSPCFile.eof()){
getline(FSPCFile,LineBuffer);
// Typical line to analyse: # 960: Address 0x00100700, type 6, UmCD1 Front 00 [TIG64-SHARC Up CD 1 Front (UmCD1f 00) 0x0100700]
stringstream myLine(LineBuffer);
myLine >> DataBuffer >> ChannelNumberStr >> DataBuffer >> DataBuffer >> DataBuffer >> DataBuffer >> DetectorName >> FrontBack >> StripNumber ;
ChannelNumberStr = ChannelNumberStr.substr(0,ChannelNumberStr.length()-1);
stringstream(ChannelNumberStr) >> ChannelNumber;
//cout << ChannelNumber << " " << DetectorName << " " << FrontBack << " " << StripNumber << endl ;
// Key is the FSPC channel,
// vector[0] is the Detector Nbr
// vector[1] is 0: QQQ , 1: Box, 2: PAD
// vector[2] the type: 0: Front , 1: Back1 or Back , 2: Back2
// vector[3] strip nbr (FSPC ref)
vector<int> FSPCInfo;
if(DetectorName.length()==5 ) {
if(DetectorName.compare(2,2,"CD")==0){
string DetectorName2 = DetectorName.substr(4);
int DetectorNbr;
stringstream(DetectorName2) >> DetectorNbr;
if(DetectorName.compare(0,1,"U")==0) {/*do nothing*/;}
else if(DetectorName.compare(0,1,"D")==0) DetectorNbr += 12;
FSPCInfo.push_back(DetectorNbr);
FSPCInfo.push_back(0);
if(FrontBack == "Front")
FSPCInfo.push_back(0);
else if (FrontBack == "Back")
FSPCInfo.push_back(1);
else {cout << "Error: FSPC File Incorrectly formatted" << endl ; exit(1);}
FSPCInfo.push_back(StripNumber);
m_FSPC2Detector[ChannelNumber]= FSPCInfo;
}
else if(DetectorName.compare(2,2,"Bx")==0){
string DetectorName2 = DetectorName.substr(4);
int DetectorNbr;
stringstream(DetectorName2) >> DetectorNbr;
if(DetectorName.compare(0,1,"U")==0) DetectorNbr += 4;
else if(DetectorName.compare(0,1,"D")==0) DetectorNbr += 8;
FSPCInfo.push_back(DetectorNbr);
FSPCInfo.push_back(1);
if(FrontBack == "Front")
FSPCInfo.push_back(0);
else if (FrontBack == "Back1")
FSPCInfo.push_back(1);
else if (FrontBack == "Back2")
FSPCInfo.push_back(2);
else {cout << "Error: FSPC File Incorrectly formatted" << endl ; exit(1);}
FSPCInfo.push_back(StripNumber);
m_FSPC2Detector[ChannelNumber]= FSPCInfo;
}
else if(DetectorName=="SHARC"){
if(FrontBack=="DoBx"){/*do nothing*/;}
else {cout << "Error: FSPC File Incorrectly formatted" << endl ; exit(1);}
int DetectorNbr=0;
if(ChannelNumber==1984) DetectorNbr = 9;
else if(ChannelNumber==1985) DetectorNbr = 10;
else if(ChannelNumber==1986) DetectorNbr = 12;
else if(ChannelNumber==1987) DetectorNbr = 11;
if(DetectorNbr!=0){
FSPCInfo.push_back(DetectorNbr);
FSPCInfo.push_back(2);
FSPCInfo.push_back(StripNumber);
m_FSPC2Detector[ChannelNumber]= FSPCInfo;
}
}
}
}
return;
}
void TSharcData::FillData(TTigEventFragment* TigEvent){
vector<int> channel_number = TigEvent->channel_number;
for(unsigned int i = 0 ; i < channel_number.size() ; i++){
if(m_FSPC2Detector.find(channel_number[i])!=m_FSPC2Detector.end()){
int DetNbr = m_FSPC2Detector[channel_number[i]][0];
int type = m_FSPC2Detector[channel_number[i]][1];
int FB = m_FSPC2Detector[channel_number[i]][2];
if(type == 0 ){
if (FB == 0 ) FillQQQFront(DetNbr , i , TigEvent);
else if (FB == 1 ) FillQQQBack (DetNbr , i , TigEvent);
}
else if (type == 1 ){
if (FB == 0 ) FillBoxFront (DetNbr , i , TigEvent);
else if (FB == 1 ) FillBoxBack1 (DetNbr , i , TigEvent);
else if (FB == 2 ) FillBoxBack2 (DetNbr , i , TigEvent);
}
else if (type == 2 ){
FillPAD(DetNbr , i , TigEvent);
}
else{cout << "ERROR: FSPC map incorrectly instantiate" << endl ; exit(1);}
}
}
}
// Fill Box
void TSharcData::FillBoxFront(int DetNbr, int hit,TTigEventFragment* TigEvent){
vector<int> channel_number = TigEvent->channel_number;
int StripNbr = m_FSPC2Detector[channel_number[hit]][3];
if(StripNbr<25){
SetFront_DetectorNbr(DetNbr);
SetFront_StripNbr(StripNbr);
SetFront_Energy(TigEvent->charge_raw[hit]);
SetFront_TimeCFD(TigEvent->cfd_value[hit]);
SetFront_TimeLED(TigEvent->led_value[hit]);
}
}
void TSharcData::FillBoxBack1(int DetNbr, int hit,TTigEventFragment* TigEvent){
vector<int> channel_number = TigEvent->channel_number;
int StripNbr = m_FSPC2Detector[channel_number[hit]][3];
if(StripNbr<25){
SetBack_DetectorNbr(DetNbr);
// Box Case, ordering is reversed
StripNbr = 25 - StripNbr;
SetBack_StripNbr(StripNbr);
SetBack_Energy(TigEvent->charge_raw[hit]);
SetBack_TimeCFD(TigEvent->cfd_value[hit]);
SetBack_TimeLED(TigEvent->led_value[hit]);
}
}
void TSharcData::FillBoxBack2(int DetNbr, int hit,TTigEventFragment* TigEvent){
vector<int> channel_number = TigEvent->channel_number;
int StripNbr = m_FSPC2Detector[channel_number[hit]][3];
if(StripNbr<25){
SetBack_DetectorNbr(DetNbr);
// Box Case, ordering is reversed
StripNbr = 25 - StripNbr;
SetBack_StripNbr(StripNbr+24);
SetBack_Energy(TigEvent->charge_raw[hit]);
SetBack_TimeCFD(TigEvent->cfd_value[hit]);
SetBack_TimeLED(TigEvent->led_value[hit]);
}
}
// Fill QQQ
void TSharcData::FillQQQFront(int DetNbr, int hit,TTigEventFragment* TigEvent){
vector<int> channel_number = TigEvent->channel_number;
int StripNbr = m_FSPC2Detector[channel_number[hit]][3];
if(StripNbr<25){
SetFront_DetectorNbr(DetNbr);
SetFront_StripNbr(StripNbr);
SetFront_Energy(TigEvent->charge_raw[hit]);
SetFront_TimeCFD(TigEvent->cfd_value[hit]);
SetFront_TimeLED(TigEvent->led_value[hit]);
}
}
void TSharcData::FillQQQBack(int DetNbr, int hit,TTigEventFragment* TigEvent){
vector<int> channel_number = TigEvent->channel_number;
int StripNbr = m_FSPC2Detector[channel_number[hit]][3];
if(StripNbr<25){
SetBack_DetectorNbr(DetNbr);
SetBack_StripNbr(StripNbr);
SetBack_Energy(TigEvent->charge_raw[hit]);
SetBack_TimeCFD(TigEvent->cfd_value[hit]);
SetBack_TimeLED(TigEvent->led_value[hit]);
}
}
// Fill PAD
void TSharcData::FillPAD(int DetNbr,int hit,TTigEventFragment* TigEvent){
SetPAD_DetectorNbr(DetNbr);
SetPAD_Energy(TigEvent->charge_raw[hit]);
SetPAD_TimeCFD(TigEvent->cfd_value[hit]);
SetPAD_TimeLED(TigEvent->led_value[hit]);
}
map< int,vector<int> > TSharcData::GetFSPC2Detector()const{
return m_FSPC2Detector;
} }
\ No newline at end of file
...@@ -28,9 +28,6 @@ ...@@ -28,9 +28,6 @@
#include <map> #include <map>
using namespace std ; using namespace std ;
// NPL
#include "../Tigress/TTigEventFragment.h"
// ROOT // ROOT
#include "TObject.h" #include "TObject.h"
...@@ -103,27 +100,6 @@ public: ...@@ -103,27 +100,6 @@ public:
unsigned int GetMultiplicityFront() const {return fSharc_StripFront_DetectorNbr.size();}//! unsigned int GetMultiplicityFront() const {return fSharc_StripFront_DetectorNbr.size();}//!
unsigned int GetMultiplicityBack() const {return fSharc_StripBack_DetectorNbr.size();}//! unsigned int GetMultiplicityBack() const {return fSharc_StripBack_DetectorNbr.size();}//!
unsigned int GetMultiplicityPAD() const {return fSharc_PAD_DetectorNbr.size();}//! unsigned int GetMultiplicityPAD() const {return fSharc_PAD_DetectorNbr.size();}//!
public: // Method and object to construct to fill the data event from a Tigress DAQ event tree
void ReadFSPCFile(string FSPCPath);//!
void FillData(TTigEventFragment* TigEvent);//!
void FillBoxFront(int DetNbr,int hit,TTigEventFragment* TigEvent);//!
void FillBoxBack1(int DetNbr,int hit,TTigEventFragment* TigEvent);//!
void FillBoxBack2(int DetNbr,int hit,TTigEventFragment* TigEvent);//!
void FillQQQFront(int DetNbr,int hit,TTigEventFragment* TigEvent);//!
void FillQQQBack(int DetNbr,int hit,TTigEventFragment* TigEvent);//!
void FillPAD(int DetNbr,int hit,TTigEventFragment* TigEvent) ;//!
map< int,vector<int> > GetFSPC2Detector() const ;//!
private:// Key is the FSPC channel,
// vector[0] is the Detector Nbr
// vector[1] is 0: QQQ , 1: Box, 2: PAD
// vector[2] the type: 0: Front , 1: Back1 or Back , 2: Back2
// vector[3] strip nbr (FSPC ref)
map< int,vector<int> > m_FSPC2Detector;//!
ClassDef(TSharcData,1) // SharcData structure ClassDef(TSharcData,1) // SharcData structure
}; };
......
...@@ -8,21 +8,17 @@ all: $(SHARELIB) ...@@ -8,21 +8,17 @@ all: $(SHARELIB)
############### Detector ############## ############### Detector ##############
## Tigress ## ## Tigress ##
libTigress.so: TTigressData.o TTigressDataDict.o TTigEventFragment.o TTigressPhysics.o TTigressPhysicsDict.o TTigressClover.o TTigressCrystal.o TTigEventFragmentDict.o libTigress.so: TTigressData.o TTigressDataDict.o TTigressPhysics.o TTigressPhysicsDict.o TTigressClover.o TTigressCrystal.o TTigEventFragmentDict.o
$(LD) $(SOFLAGS) $^ $(OutPutOpt) $@ $(LD) $(SOFLAGS) $^ $(OutPutOpt) $@
TTigressDataDict.cxx: TTigressData.h TTigressDataDict.cxx: TTigressData.h
rootcint -f $@ -c $^ rootcint -f $@ -c $^
TTigEventFragmentDict.cxx: TTigEventFragment.h
rootcint -f $@ -c $^
TTigressPhysicsDict.cxx: TTigressPhysics.h TTigressPhysicsDict.cxx: TTigressPhysics.h
rootcint -f $@ -c $^ rootcint -f $@ -c $^
# dependances # dependances
TTigressData.o: TTigressData.cxx TTigressData.h TTigressData.o: TTigressData.cxx TTigressData.h
TTigEventFragment.o: TTigEventFragment.cxx TTigEventFragment.h
TTigressPhysics.o: TTigressPhysics.cxx TTigressPhysics.h TTigressPhysics.o: TTigressPhysics.cxx TTigressPhysics.h
TTigressClover.o: TTigressClover.cxx TTigressClover.h TTigressClover.o: TTigressClover.cxx TTigressClover.h
TTigressCrystal.o: TTigressCrystal.cxx TTigressCrystal.h TTigressCrystal.o: TTigressCrystal.cxx TTigressCrystal.h
......
/*****************************************************************************
* Copyright (C) 2009-2013 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: contact address: *
* *
* Creation Date : *
* Last update : *
*---------------------------------------------------------------------------*
* Decription: *
* *
* *
*---------------------------------------------------------------------------*
* Comment: *
* *
* *
*****************************************************************************/
#include"TTigEventFragment.h"
ClassImp(TTigEventFragment)
extern int midas_events_read;
TTigEventFragment::TTigEventFragment(){
Clear();
}
TTigEventFragment::TTigEventFragment(int MaxChannel){
tig_midas_id.reserve(MaxChannel);
tig_type.reserve(MaxChannel);
channel_number.reserve(MaxChannel);
channel_raw.reserve(MaxChannel);
cfd_value.reserve(MaxChannel);
led_value.reserve(MaxChannel);
charge_raw.reserve(MaxChannel);
charge_cal.reserve(MaxChannel);
timestamp_low.reserve(MaxChannel);
timestamp_high.reserve(MaxChannel);
timestamp_live.reserve(MaxChannel);
timestamp_tr.reserve(MaxChannel);
timestamp_ta.reserve(MaxChannel);
waveform.reserve(MaxChannel);
}
TTigEventFragment::~TTigEventFragment(){
Clear();
}
void TTigEventFragment::Clear(){
tig_num_chan=0;
tig_event_id=0;
tig_midas_id.clear();
tig_type.clear();
channel_number.clear();
channel_raw.clear();
cfd_value.clear();
led_value.clear();
charge_raw.clear();
charge_cal.clear();
timestamp_low.clear();
timestamp_high.clear();
timestamp_live.clear();
timestamp_tr.clear();
timestamp_ta.clear();
waveform.clear();
}
#ifndef TTigEventFragment_H
#define TTigEventFragment_H
/*****************************************************************************
* Copyright (C) 2009-2013 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: contact address: *
* *
* Creation Date : *
* Last update : *
*---------------------------------------------------------------------------*
* Decription: *
* *
* *
*---------------------------------------------------------------------------*
* Comment: *
* *
*****************************************************************************/
#include"TObject.h"
#include"TH1F.h"
#include <vector>
using namespace std;
class TTigEventFragment : public TObject{
public:
TTigEventFragment();
// Create the class and reserve the vector size for MaxChannel
// Limit the number of dynamic allocation, so better perf but more memory used
TTigEventFragment(int MaxChannel);
~TTigEventFragment();
public:
int tig_num_chan;
int tig_event_id;
vector<int> tig_midas_id;
//0 for tig10 and 1 for tig 64
vector<int> tig_type;
vector<int> channel_number;
vector<int> channel_raw;
vector<int> cfd_value;
vector<int> led_value;
vector<int> charge_raw;
vector<float> charge_cal;
vector<int> timestamp_low;
vector<int> timestamp_high;
vector<int> timestamp_live;
vector<int> timestamp_tr; // triggers requested
vector<int> timestamp_ta; // triggers accepted
vector<TH1F> waveform;
public:
void Clear() ;
void Clear(const Option_t*) {};
void Dump() const {};
ClassDef(TTigEventFragment,1) // TTigEventFragment structure
};
#endif
...@@ -69,137 +69,4 @@ void TTigressData::Dump() const ...@@ -69,137 +69,4 @@ void TTigressData::Dump() const
// << " Energy: " << fTIG_Energy[i] // << " Energy: " << fTIG_Energy[i]
// << " Time: " << fTIG_Time[i] << endl; // << " Time: " << fTIG_Time[i] << endl;
// } // }
} }
\ No newline at end of file
// Key is the FSPC channel,
// vector[0] is the Clover Nbr
// vector[1] is the crystal Nbr
// vector[2] is the segment Nbr
// vector[3] is 0: Ge , 1: BGO
void TTigressData::ReadFSPCFile(string FSPCPath){
ifstream FSPCFile;
FSPCFile.open(FSPCPath.c_str());
if(!FSPCFile.is_open()) {cout << "Error: FSPC File: " << FSPCPath << " not found " << endl ; exit(1);}
else {cout << "Tigress is Reading FSPC file : " << FSPCPath << endl ;}
string LineBuffer;
string DataBuffer;
string DetectorName;
string ChannelNumberStr;
int ChannelNumber;
while(!FSPCFile.eof()){
getline(FSPCFile,LineBuffer);
/* Typical line to analyse: 1st for Ge, 2nd for BGO
# 9: Address 0x00e00109, type 3, Ge01Bc0 [HPGe Pos01 Blue Core 9 0x0e00109]
# 10: Address 0x00e00200, type 4, Sup01Bs0 [Suppressor Pos01 Blue Seg 0 0x0e00200]
*/
stringstream myLine(LineBuffer);
myLine >> DataBuffer >> ChannelNumberStr >> DataBuffer >> DataBuffer >> DataBuffer >> DataBuffer>> DetectorName;
ChannelNumberStr = ChannelNumberStr.substr(0,ChannelNumberStr.length()-1);
stringstream(ChannelNumberStr) >> ChannelNumber;
vector<int> FSPCInfo;
if(DetectorName.length()==7 || DetectorName.length()==8 ) {
if(DetectorName.compare(0,2,"Ge")==0 && DetectorName.length()==7){ // Very specific to avoid conflict with possible future change
string DetectorName2 = DetectorName.substr(2,2);
int CloverNbr=0;
stringstream(DetectorName2) >> CloverNbr;
DetectorName2 = DetectorName.substr(4,1);
int CrystalNbr=0;
if (DetectorName2 == "B") CrystalNbr=1;
else if (DetectorName2 == "G") CrystalNbr=2;
else if (DetectorName2 == "R") CrystalNbr=3;
else if (DetectorName2 == "W") CrystalNbr=4;
else {cout << "ERROR: FSPC File incorrect" << endl ; exit(1);}
DetectorName2 = DetectorName.substr(6,1);
int SegmentNbr;
stringstream(DetectorName2) >> SegmentNbr;
FSPCInfo.push_back(CloverNbr);
FSPCInfo.push_back(CrystalNbr);
FSPCInfo.push_back(SegmentNbr);
FSPCInfo.push_back(0);
if(CloverNbr!=0) m_FSPC2Detector[ChannelNumber]= FSPCInfo;
}
else if(DetectorName.compare(0,3,"Sup")==0 && DetectorName.length()==8){ // Very specific to avoid conflict with possible future change
string DetectorName2 = DetectorName.substr(3,2);
int CloverNbr=0;
stringstream(DetectorName2) >> CloverNbr;
DetectorName2 = DetectorName.substr(5,1);
int CrystalNbr=0;
if (DetectorName2 == "B") CrystalNbr=1;
else if (DetectorName2 == "G") CrystalNbr=2;
else if (DetectorName2 == "R") CrystalNbr=3;
else if (DetectorName2 == "W") CrystalNbr=4;
else {cout << "ERROR: FSPC File incorrect" << endl ; exit(1);}
DetectorName2 = DetectorName.substr(7,1);
int PmNbr;
stringstream(DetectorName2) >> PmNbr;
FSPCInfo.push_back(CloverNbr);
FSPCInfo.push_back(CrystalNbr);
FSPCInfo.push_back(PmNbr);
FSPCInfo.push_back(1);
if(CloverNbr!=0) m_FSPC2Detector[ChannelNumber]= FSPCInfo;
}
}
}
return;
}
void TTigressData::FillData(TTigEventFragment* TigEvent){
vector<int> channel_number = TigEvent->channel_number;
for(unsigned int i = 0 ; i < channel_number.size() ; i++){
if(m_FSPC2Detector.find(channel_number[i])!=m_FSPC2Detector.end()){
int CloverNbr = m_FSPC2Detector[channel_number[i]][0];
int CrystalNbr = m_FSPC2Detector[channel_number[i]][1];
int SegmentNbr = m_FSPC2Detector[channel_number[i]][2];
int type = m_FSPC2Detector[channel_number[i]][3];
if (type == 0) {
FillGe(CloverNbr,CrystalNbr,SegmentNbr,i,TigEvent);
}
else if(type == 1){
FillBGO(CloverNbr,CrystalNbr,SegmentNbr,i,TigEvent);
}
else{cout << "ERROR: FSPC map incorrectly instantiate" << endl ; exit(1);}
}
}
}
void TTigressData::FillGe(unsigned short GeCloverNbr, unsigned short GeCrystalNbr , unsigned short GeSegmentNbr, int hit,TTigEventFragment* TigEvent){
SetGeCloverNbr( GeCloverNbr);
SetGeCrystalNbr( GeCrystalNbr);
SetGeSegmentNbr( GeSegmentNbr);
SetGeEnergy(TigEvent->charge_raw[hit]);
SetGeTimeCFD( TigEvent->cfd_value[hit]);
SetGeTimeLED( TigEvent->led_value[hit]);
}
void TTigressData::FillBGO(unsigned short BGOCloverNbr, unsigned short BGOCrystalNbr , unsigned short BGOPmNbr, int hit,TTigEventFragment* TigEvent){
SetBGOCloverNbr( BGOCloverNbr);
SetBGOCrystalNbr( BGOCrystalNbr);
SetBGOPmNbr( BGOPmNbr);
SetBGOEnergy( TigEvent->charge_raw[hit]);
SetBGOTimeCFD( TigEvent->cfd_value[hit]);
SetBGOTimeLED( TigEvent->led_value[hit]);
}
...@@ -27,9 +27,6 @@ ...@@ -27,9 +27,6 @@
#include <map> #include <map>
using namespace std ; using namespace std ;
// NPL
#include "TTigEventFragment.h"
// ROOT // ROOT
#include "TObject.h" #include "TObject.h"
...@@ -93,22 +90,6 @@ public: ...@@ -93,22 +90,6 @@ public:
unsigned int GetMultiplicityGe() {return fTIG_Ge_CloverNbr.size();} unsigned int GetMultiplicityGe() {return fTIG_Ge_CloverNbr.size();}
unsigned int GetMultiplicityBGO() {return fTIG_BGO_CloverNbr.size();} unsigned int GetMultiplicityBGO() {return fTIG_BGO_CloverNbr.size();}
public: // Method and object to construct to fill the data event from a Tigress DAQ event tree
void ReadFSPCFile(string FSPCPath);//!
void FillData(TTigEventFragment* TigEvent);//!
void FillGe(unsigned short GeCloverNbr, unsigned short GeCrystalNbr , unsigned short GeSegmentNbr, int hit,TTigEventFragment* TigEvent);
void FillBGO(unsigned short BGOCloverNbr, unsigned short BGOPmNbr , unsigned short BGOSegmentNbr, int hit,TTigEventFragment* TigEvent);
map< int,vector<int> > GetFSPC2Detector() const {return m_FSPC2Detector;}//!
private:// Key is the FSPC channel,
// vector[0] is the Clover Nbr
// vector[1] is the crystal Nbr
// vector[2] is the segment Nbr
// vector[3] is 0: Ge , 1: BGO
map< int,vector<int> > m_FSPC2Detector;//!
ClassDef(TTigressData,1) // TigressData structure ClassDef(TTigressData,1) // TigressData structure
}; };
......
...@@ -57,41 +57,3 @@ void TTrifoilData::Clear() ...@@ -57,41 +57,3 @@ void TTrifoilData::Clear()
void TTrifoilData::Dump() const void TTrifoilData::Dump() const
{ {
} }
/////////////////////////
void TTrifoilData::ReadFSPCFile(string FSPCPath){
ifstream FSPCFile;
FSPCFile.open(FSPCPath.c_str());
if(!FSPCFile.is_open()) {cout << "Error: FSPC File: " << FSPCPath << " not found " << endl ; exit(1);}
else {cout << "Trifoil is Reading FSPC file : " << FSPCPath << endl ;}
string LineBuffer;
string DataBuffer;
string DetectorName;
string ChannelNumberStr;
int ChannelNumber;
while(!FSPCFile.eof()){
getline(FSPCFile,LineBuffer);
/* Typical line to analyse:
# 2005: Address 0x00900800, type 8, Trifoil [Trifoil 0x0900800]
*/
stringstream myLine(LineBuffer);
myLine >> DataBuffer >> ChannelNumberStr >> DataBuffer >> DataBuffer >> DataBuffer >> DataBuffer >> DetectorName ;
ChannelNumberStr = ChannelNumberStr.substr(0,ChannelNumberStr.length()-1);
stringstream(ChannelNumberStr) >> ChannelNumber;
if(DetectorName=="Trifoil") m_FSPC_Channel=ChannelNumber;
}
}
void TTrifoilData::FillData(TTigEventFragment* TigEvent){
vector<int> channel_number = TigEvent->channel_number;
for(unsigned int i = 0 ; i < channel_number.size() ; i++){
if(channel_number[i] == m_FSPC_Channel){
fTrifoil_Waveform.push_back(TigEvent->waveform[i]);
fTrifoil_TimeCFD.push_back(TigEvent->cfd_value[i]);
fTrifoil_TimeLED.push_back(TigEvent->led_value[i]);
}
}
}
...@@ -28,9 +28,6 @@ ...@@ -28,9 +28,6 @@
#include <map> #include <map>
using namespace std ; using namespace std ;
// NPL
#include "../Tigress/TTigEventFragment.h"
// ROOT // ROOT
#include "TObject.h" #include "TObject.h"
#include "TH1F.h" #include "TH1F.h"
...@@ -62,13 +59,6 @@ public: ...@@ -62,13 +59,6 @@ public:
Double_t GetTimeLED(int i) {return fTrifoil_TimeLED[i];} Double_t GetTimeLED(int i) {return fTrifoil_TimeLED[i];}
unsigned int GetMultiplicity() {return fTrifoil_TimeCFD.size();} unsigned int GetMultiplicity() {return fTrifoil_TimeCFD.size();}
public: // Method and object to construct to fill the data event from a Tigress DAQ event tree
void ReadFSPCFile(string FSPCPath);//!
void FillData(TTigEventFragment* TigEvent);//!
private:
int m_FSPC_Channel;//!
ClassDef(TTrifoilData,1) // TrifoilData structure ClassDef(TTrifoilData,1) // TrifoilData structure
}; };
......
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