Commit c780ec1a authored by J.Dudouet [IPNL/CSNSM]'s avatar J.Dudouet [IPNL/CSNSM]
Browse files

Define branches in NEDA root trees.

adapt the GuiBuildTree to neda and diamant frames


git-svn-id: svn+ssh://anonsvn.in2p3.fr/agata/gammaware/trunk@2240 c3abf467-7ff2-0310-b516-c5fb849bdde0
parent c4527b8a
......@@ -118,9 +118,6 @@ GuiBuildTree::GuiBuildTree(const TGWindow *p, UInt_t w, UInt_t h) :
fNEAGATAOffset = new TGNumberEntry(fHorizontalFrame, 0., 8,-1, TGNumberFormat::kNESReal);
fNEAGATAOffset->Connect("ValueSet(Long_t)", "GuiBuildTree", this, "Update()");
fHorizontalFrame->AddFrame(fNEAGATAOffset,new TGLayoutHints(kLHintsTop | kLHintsLeft,0,0,5,5));
fHorizontalFrame = new TGCompositeFrame(fTreeReaderTab, 60, 20, kHorizontalFrame);
fTreeReaderTab->AddFrame(fHorizontalFrame,new TGLayoutHints(kLHintsTop | kLHintsLeft | kLHintsExpandX, 0, 0, 5, 0));
fHorizontalFrame->AddFrame(new TGLabel(fHorizontalFrame, "Use PSA Hits : "),new TGLayoutHints(kLHintsTop | kLHintsLeft, 10, 5, 8, 0));
fUsePSAHitsButton = new TGCheckButton(fHorizontalFrame, "", -6000);
fUsePSAHitsButton->Connect("Clicked()","GuiBuildTree", this, "HandleButtons()");
......@@ -128,6 +125,18 @@ GuiBuildTree::GuiBuildTree(const TGWindow *p, UInt_t w, UInt_t h) :
fUsePSAHits = true;
fHorizontalFrame->AddFrame(fUsePSAHitsButton, new TGLayoutHints(kLHintsTop | kLHintsLeft,5,0,8,0));
fHorizontalFrame = new TGCompositeFrame(fTreeReaderTab, 60, 20, kHorizontalFrame);
fTreeReaderTab->AddFrame(fHorizontalFrame,new TGLayoutHints(kLHintsTop | kLHintsLeft | kLHintsExpandX, 0, 0, 5, 0));
fHorizontalFrame->AddFrame(new TGLabel(fHorizontalFrame, "Use NEDA : "),new TGLayoutHints(kLHintsTop | kLHintsLeft, 10, 5, 8, 0));
fUseNEDAButton = new TGCheckButton(fHorizontalFrame, "", -3100);
fUseNEDAButton->Connect("Clicked()","GuiBuildTree", this, "HandleButtons()");
fUseNEDA = false;
fHorizontalFrame->AddFrame(fUseNEDAButton, new TGLayoutHints(kLHintsTop | kLHintsLeft,5,0,8,0));
fHorizontalFrame->AddFrame(new TGLabel(fHorizontalFrame, "Use DIAMANT : "),new TGLayoutHints(kLHintsTop | kLHintsLeft, 10, 5, 8, 0));
fUseDIAMANTButton = new TGCheckButton(fHorizontalFrame, "", -3200);
fUseDIAMANTButton->Connect("Clicked()","GuiBuildTree", this, "HandleButtons()");
fUseDIAMANT = false;
fHorizontalFrame->AddFrame(fUseDIAMANTButton, new TGLayoutHints(kLHintsTop | kLHintsLeft,5,0,8,0));
fResumeBox = new TGListBox(fTreeReaderTab);
fTreeReaderTab->AddFrame(fResumeBox, new TGLayoutHints(kLHintsTop | kLHintsLeft | kLHintsExpandX | kLHintsExpandY,0,0,5,5));
......@@ -315,22 +324,63 @@ void GuiBuildTree::PrintConfig()
PrintInListBox(fResumeBox,"Summary of the configuration",kInfo);
PrintInListBox(fResumeBox,Form("AgataFrameTrigger : %s",fTriggerName.Data()),kInfo);
if(fUseNEDA)
{
if(fTriggerName.Contains("event:data:ranc0"))
PrintInListBox(fResumeBox,"Neda data stored",kPrint);
else
PrintInListBox(fResumeBox,"Neda data stored ==> Trigger does not contain event:data:ranc0",kWarning);
}
else
PrintInListBox(fResumeBox,"No NEDA data",kError);
if(fUseDIAMANT)
{
if(fTriggerName.Contains("event:data:ranc1"))
PrintInListBox(fResumeBox,"DIAMANT data stored",kPrint);
else
PrintInListBox(fResumeBox,"DIAMANT data stored ==> Trigger does not contain event:data:ranc1",kWarning);
}
else
PrintInListBox(fResumeBox,"No DIAMANT data",kError);
if(fUseVAMOS)
{
if(fUseVertexBuilder)
PrintInListBox(fResumeBox,Form("Use vamos in mode %d with vertex builder",fVAMOSMode),kPrint);
{
if(fTriggerName.Contains(" data:ranc0") || fTriggerName.Contains("!data:ranc0") || fTriggerName.Contains("|data:ranc0"))
PrintInListBox(fResumeBox,Form("Use vamos in mode %d with vertex builder",fVAMOSMode),kPrint);
else
PrintInListBox(fResumeBox,Form("Use vamos in mode %d with vertex builder ==> Trigger does not contain data:ranc0",fVAMOSMode),kWarning);
}
else
PrintInListBox(fResumeBox,Form("Use vamos in mode %d without vertex builder",fVAMOSMode),kPrint);
{
if(fTriggerName.Contains(" data:ranc0") || fTriggerName.Contains("!data:ranc0") || fTriggerName.Contains("|data:ranc0"))
PrintInListBox(fResumeBox,Form("Use vamos in mode %d without vertex builder",fVAMOSMode),kPrint);
else
PrintInListBox(fResumeBox,Form("Use vamos in mode %d without vertex builder ==> Trigger does not contain data:ranc0",fVAMOSMode),kWarning);
}
}
else
PrintInListBox(fResumeBox,"Vamos not used",kError);
if(fUseTracking)
PrintInListBox(fResumeBox,Form("OFT tracking with z offset = %g mm",fAGATAOffset),kPrint);
{
if(fTriggerName.Contains("data:tracked"))
PrintInListBox(fResumeBox,Form("OFT tracking with z offset = %g mm",fAGATAOffset),kPrint);
else
PrintInListBox(fResumeBox,Form("OFT tracking with z offset = %g mm ==> Trigger does not contain data:tracked",fAGATAOffset),kWarning);
}
else
PrintInListBox(fResumeBox,"No tracking",kError);
if(fUsePSAHits)
PrintInListBox(fResumeBox,"PSA Hits stored",kPrint);
{
if(fTriggerName.Contains("event:data:psa"))
PrintInListBox(fResumeBox,"PSA Hits stored",kPrint);
else
PrintInListBox(fResumeBox,"PSA Hits stored ==> Trigger does not contain evente:data:psa",kWarning);
}
else
PrintInListBox(fResumeBox,"No PSA Hits",kError);
......@@ -440,6 +490,18 @@ void GuiBuildTree::ProcessRun(int RunIndex)
TTreeMaster *rootmaster = fd->AddTreeMaster(Form("%s%s",fPatternOfROOTFiles.Data(),foldername.Data()) , fTTeeTilte.Data(), fOverwritefile);
#ifdef WITH_MFM
if(fUseNEDA)
{
rootmaster->Add<EventNEDATree>("NEDA","Neda branch");
}
if(fUseDIAMANT)
{
rootmaster->Add<EventNEDATree>("DIAMANT","DIAMANT branch");
}
#endif
#ifdef HAS_VAMOS
if(fUseVAMOS)
{
// This adds a VAMOS Watcher. The data containt depemds on the MODE
......@@ -452,6 +514,7 @@ void GuiBuildTree::ProcessRun(int RunIndex)
rootmaster->AddWatcher<VAMOSVertexBuilder>("VAMOSVertexBuilder","To Compute a vertex from VAMOS library");
}
}
#endif
if(fUseTracking)
{
......@@ -730,17 +793,21 @@ void GuiBuildTree::HandleButtons(Int_t id)
if(fUseVAMOS==false)
fUseVertexBuilderButton->SetState(kButtonDisabled);
}
if(id==-3100) //Use NEDA Hits
fUseNEDA = btn->IsOn();
if(id==-3200) //Use DIAMANT Hits
fUseDIAMANT = btn->IsOn();
if(id==-4000) //Use vertexbuilder
fUseVertexBuilder = btn->IsOn();
if(id==-5000) //Use vertexbuilder
if(id==-5000) //Use Tracking
{
fUseTracking = btn->IsOn();
fNEAGATAOffset->SetState(fUseTracking);
}
if(id==-6000) //Use vertexbuilder
if(id==-6000) //Use PSA Hits
fUsePSAHits = btn->IsOn();
Update();
......@@ -755,6 +822,8 @@ void GuiBuildTree::DisableEntries()
fUseTrackingButton->SetState(kButtonDisabled);
fNEAGATAOffset->SetState(false);
fUsePSAHitsButton->SetState(kButtonDisabled);
fUseNEDAButton->SetState(kButtonDisabled);
fUseDIAMANTButton->SetState(kButtonDisabled);
fExpPath->SetState(false);
fRunPatt->SetState(false);
......@@ -799,6 +868,8 @@ void GuiBuildTree::EnableEntries()
fUseTrackingButton->SetState((EButtonState)fUseTracking);
fUsePSAHitsButton->SetState((EButtonState)fUsePSAHits);
fUseNEDAButton->SetState((EButtonState)fUseNEDA);
fUseDIAMANTButton->SetState((EButtonState)fUseDIAMANT);
}
......@@ -811,6 +882,8 @@ void GuiBuildTree::SaveConfig()
outputfile<<fUseTracking<<endl;
outputfile<<fAGATAOffset<<endl;
outputfile<<fUsePSAHits<<endl;
outputfile<<fUseNEDA<<endl;
outputfile<<fUseDIAMANT<<endl;
outputfile<<fTriggerName<<endl;
outputfile<<fwhich_experiment<<endl;
outputfile<<frun_name_pattern<<endl;
......@@ -853,6 +926,13 @@ void GuiBuildTree::LoadConfig()
if(fUsePSAHits==false)
fUsePSAHitsButton->SetState(kButtonUp);
getline(outputfile,line);fUseNEDA = atoi(line.c_str());
if(fUseNEDA==true)
fUseNEDAButton->SetState(kButtonDown);
getline(outputfile,line);fUseDIAMANT = atoi(line.c_str());
if(fUseDIAMANT==true)
fUseDIAMANTButton->SetState(kButtonDown);
getline(outputfile,line);fTETrigger->SetTitle(line.c_str());
getline(outputfile,line);fExpPath->SetTitle(line.c_str());
getline(outputfile,line);fRunPatt->SetTitle(line.c_str());
......
......@@ -34,6 +34,11 @@
#include "RootAFP.h"
#include "BashColor.h"
#ifdef WITH_MFM
#include "EventNEDAWatchers.h"
#include "EventDIAMANTWatchers.h"
#endif
// root/system includes
#include "TRegexp.h"
#include "TSystem.h"
......@@ -103,7 +108,8 @@ class GuiBuildTree : public TGMainFrame
TGCheckButton *fUseVertexBuilderButton;
TGCheckButton *fUseTrackingButton;
TGCheckButton *fUsePSAHitsButton;
TGCheckButton *fUseNEDAButton;
TGCheckButton *fUseDIAMANTButton;
TGNumberEntry *fRunMin;
TGNumberEntry *fRunMax;
......@@ -128,6 +134,8 @@ class GuiBuildTree : public TGMainFrame
TString fTTeeTilte;
bool fUseVAMOS;
bool fUseNEDA;
bool fUseDIAMANT;
bool fUseVertexBuilder;
int fVAMOSMode;
bool fUseTracking;
......
......@@ -20,6 +20,8 @@
#include "EventNEDAWatchers.h"
#include "AgataKeyFactory.h"
#include "DFAgent.h"
#include "TH3.h"
#include "TH2.h"
......@@ -142,10 +144,16 @@ EventNEDATree::~EventNEDATree()
void EventNEDATree::SetBranches()
{
GetTree()->Branch("NEDA.number_of_neda",&number_of_neda,"number_of_neda/I");
GetTree()->Branch( "NEDA.BoardId_c", BoardId_c, "BoardId_c[number_of_neda]/s" );
GetTree()->Branch( "NEDA.ChannelId_c", ChannelId_c, "ChannelId_c[number_of_neda]/s" );
GetTree()->Branch("nbNEDA", &nbNEDA, "nbNEDA/I");
GetTree()->Branch("NEDABoard", BoardId, "BoardId[nbNEDA]/s" );
GetTree()->Branch("NEDAChannel", ChannelId, "ChannelId[nbNEDA]/s" );
GetTree()->Branch("NEDATdc", NEDATdc, "NEDATdc[nbNEDA]/s" );
GetTree()->Branch("NEDAFast", NEDAFast, "NEDAFast[nbNEDA]/s" );
GetTree()->Branch("NEDASlow", NEDASlow, "NEDASlow[nbNEDA]/s" );
GetTree()->Branch("NEDAZco", NEDAZco, "NEDAZco[nbNEDA]/s" );
GetTree()->Branch("TSNEDA", &fTimestamp, "TSNeda/l" );
}
void EventNEDATree::Exec(Option_t * /*option*/)
......@@ -154,37 +162,26 @@ void EventNEDATree::Exec(Option_t * /*option*/)
SetLastExecStatus(1u);
return;
}
fTimestamp = ((AgataKey *)fFrame->GetFrame()->GetKey())->GetTimeStamp();
UInt_t number_of_frame = GetNbSubFrame(); nbNEDA = number_of_frame;
// fTimestamp = ((AgataKey *)fFrame->GetFrame()->GetKey())->GetTimeStamp();
// fEfvtNbr = ((AgataKey *)fFrame->GetFrame()->GetKey())->GetEventNumber();
//
// const PSAInterface *data = GetCstDataPointer<PSAInterface>(fFrame);
//
// number_of_hits = data->GetNbHits();
// coreE0 = data->GetE(0u);
// coreE1 = data->GetE(1u);
// coreT0 = data->GetT(0u);
// coreT1 = data->GetT(1u);
//
// for( UShort_t i=0u; i < number_of_hits; i++ )
// {
// hitSg[i] = data->GetHit(i)->GetID(0);
// hitE[i] = data->GetHit(i)->GetE();
// hitX[i] = data->GetHit(i)->GetX();
// hitY[i] = data->GetHit(i)->GetY();
// hitZ[i] = data->GetHit(i)->GetZ();
// }
UInt_t number_of_frame = GetNbSubFrame(); number_of_neda = number_of_frame;
for(UInt_t i = 0u; i <number_of_frame; i++) {
for(UInt_t i = 0u; i <number_of_frame; i++)
{
MFMNedaFrame *mfmframe = GetMFM(i);
if ( mfmframe == 0x0 ){
std::cout << "BUG" << std::endl;
continue;
}
BoardId_c[i] = mfmframe->GetBoardId(); ChannelId_c[i] = mfmframe->GetChannelId() ;
BoardId[i] = mfmframe->GetBoardId();
ChannelId[i] = mfmframe->GetChannelId() ;
NEDATdc[i] = mfmframe->GetTdcValue();
NEDAFast[i] = mfmframe->GetFastIntegral();
NEDASlow[i] = mfmframe->GetSlowIntegral();
NEDAZco[i] = mfmframe->GetZcoInterval();
}
FillTree();
......
......@@ -110,9 +110,11 @@ class EventNEDATree : public EventNEDAWatchers, public TTreeBuilder
static const Int_t MaxNEDA = 196;
private:
Int_t number_of_neda; // Number of hits in the array
UShort_t BoardId_c[MaxNEDA], ChannelId_c[MaxNEDA];
Int_t nbNEDA; // Number of hits in the array
UShort_t BoardId[MaxNEDA], ChannelId[MaxNEDA];
UShort_t NEDATdc[MaxNEDA], NEDAFast[MaxNEDA], NEDASlow[MaxNEDA] ,NEDAZco[MaxNEDA];
ULong64_t fTimestamp;
protected:
virtual void SetBranches();
......
......@@ -244,6 +244,9 @@ void LoadWatchers_ANCILLARIES()
else {
printf("{Conf} Set ANALYSIS_AGATA to ./ConfVAMOS \n"); gSystem->Setenv("ANALYSIS_AGATA","./ConfVAMOS");
}
// to be changed in DefaultGANIL
LoadClass(Form("DefaultWatchers/%s/GANILWatchers.C",CAMPAIGN.Data()));
}
if ( GRUDIR != "" ) {
cout << "- Load libGRU.so from " << GRUDIR.Data() << endl;
......@@ -253,8 +256,9 @@ void LoadWatchers_ANCILLARIES()
gROOT->ProcessLine(tmp.Data());
}
// to be changed in DefaultGANIL
LoadClass(Form("DefaultWatchers/%s/GANILWatchers.C",CAMPAIGN.Data()));
LoadClass(Form("DefaultWatchers/%s/EventNEDAWatchers.C",CAMPAIGN.Data()));
LoadClass(Form("DefaultWatchers/%s/EventDIAMANTWatchers.C",CAMPAIGN.Data()));
std::cout << AncW << " Watchers for ancillaries DONE" << EndColor << std::endl;
}
......
......@@ -50,6 +50,11 @@ void ADF_to_Tree(Int_t Run,
#include "TRegexp.h"
#include "TSystem.h"
#ifdef WITH_MFM
#include "EventNEDAWatchers.h"
#include "EventDIAMANTWatchers.h"
#endif
//! This is the part the user should adapt to his needs
namespace {
TString PathToOut = "./Out"; // path where to store TTrees
......@@ -69,21 +74,32 @@ void PrintStats(BaseEmulatorChain *emulator);
void ADF_to_Tree_UserSetup( Gw::FrameDispatcher *fd)
{
// Trigger means event:data with inside a data:tracked AND an event:data:pas AND an ancillary
AgataFrameTrigger *trig = AgataFrameTrigger::Build("Event", "event:data data:tracked event:data:psa data:ranc0");
AgataFrameTrigger *trig = AgataFrameTrigger::Build("Event", "event:data |data:tracked |event:data:psa |data:ranc0 |event:data:ranc0 |event:data:ranc1");
fd->SetTrigger(trig);
// ROOT Tree with Raw Branch and VAMOS one
TTreeMaster *rootmaster = fd->AddTreeMaster(Form("%s%s",PatternOfROOTFiles.Data(),Run.Data()) , TTeeTilte.Data(), OverWriteFile);
#ifdef HAS_VAMOS
// This adds a VAMOS Watcher. The data containt depemds on the MODE
VAMOSWatcher *vamosw = rootmaster->Add<VAMOSWatcher>("GVWInterface","Branch managed by the VAMOS librarie");
vamosw->InitVAMOS(2,Form("%s/VAMOS_Spectra_%s.root",PathToOut.Data(),Run.Data()),RunNr,PathToOut.Data());
// this compute from VAMOS the Doppler correction used in the branches/watcher following this
rootmaster->AddWatcher<VAMOSVertexBuilder>("VAMOSVertexBuilder","To Compute a vertex from VAMOS library");
// // Tracked Part
#endif
// Tracked part
ADTrackTree *trackw = rootmaster->Add<ADTrackTree>("TrackTree","Branch on track");
trackw->SetAgataOffset(0.);
// Hit part
rootmaster->Add<ADHitTree>("HitTree","Branch on hits");
#ifdef WITH_MFM
// Neda part
rootmaster->Add<EventNEDATree>("NEDA","Neda branch");
#endif
}
void ADF_to_Tree(const Char_t *rootafpconf)
......
......@@ -38,6 +38,11 @@
#include "EventWatchers.h"
#include "MetaWatchers.h"
#ifdef WITH_MFM
#include "EventNEDAWatchers.h"
#include "EventDIAMANTWatchers.h"
#endif
//! always at least MFM ... other librarires, protection onside GANILWatchers.h
//#include "GANILWatchers.h"
......@@ -172,13 +177,6 @@ Bool_t SetupWatchers(const char *df_type, FrameDispatcher *fd, const char *ext =
AgataFrameTrigger::Build("RANC0", "data:ranc0");
fd->SetTrigger(trig);
// watcher to keep rates
// fd->Add<MFMWatcher>(GetWN("MFMWatcher",ext),"To check the MFM Content");
#ifdef HAS_VAMOS
// TTreeMaster *rootmaster = fd->Add<TTreeMaster>("TreeMaster","Own the tree");
// VAMOSWatcher *vw = rootmaster->Add<VAMOSWatcher>("GVWInterface","See Spectra in Out/VAMOS_Spectra.root");
// vw->InitVAMOS(0,"Out/VAMOS_Spectra.root");
#endif
fd->Add<KeyWatcher>("Vamos_Keys","AgataKeys Watcher for the ancilary level");
ok = true;
......@@ -192,13 +190,12 @@ Bool_t SetupWatchers(const char *df_type, FrameDispatcher *fd, const char *ext =
// It defines a trigger on an event:data:psa Frame
AgataFrameTrigger *trig = AgataFrameTrigger::Build("EventPSA", "event:data event:data:psa" );
// AgataFrameTrigger *trig = AgataFrameTrigger::Build("EventPSA", "event:data event:data:psa" );
fd->SetTrigger(trig);
fd->Add<EBWatcher>(GetWN("EventBuilder",ext),"Display Agata spectra at the event builder level");
// fd->Add<TimeCheckBuilder>(GetWN("TimeCheckBuilder",ext),"Check linearity of crystal values");
// fd->Add<TimeCheckBuilder>(GetWN("TimeCheckBuilder",ext),"Check linearity of crystal values");
fd->Add<KeyWatcher>("EventBuilder_Keys","AgataKeys Watcher at the event builder level");
......@@ -211,17 +208,8 @@ Bool_t SetupWatchers(const char *df_type, FrameDispatcher *fd, const char *ext =
// set the main trigger to coincidences between ancillary et gammas
fd->SetTrigger(trig);
/*
#ifdef HAS_GANIL
// fd->Add<MFMWatcher>(GetWN("MFMWatcher",ext),"To check the MFM Content");
TTreeMaster *rootmaster = fd->Add<TTreeMaster>("TreeMaster","Own the tree");
rootmaster->Add<RawMFMTree>("RawMFMTree","Branch on Raw MFM");
VAMOSWatcher *vw = rootmaster->Add<VAMOSWatcher>("GVWInterface","Branch managed by the VAMOS librarie");
vw->InitVAMOS(0,Form("Out/VAMOS_Spectra.root"));
// rootmaster->AddWatcher<VAMOSVertexBuilder>(GetWN("VAMOSVertexBuilder",ext),"To Compute a vertex from VAMOS library");
#ifdef HAS_VAMOS
fd->Add<VAMOSVertexBuilder>("VAMOSVertexBuilder","Check Doppler as computed by VAMOS");
......@@ -231,13 +219,13 @@ Bool_t SetupWatchers(const char *df_type, FrameDispatcher *fd, const char *ext =
fd->Add<AGATAVAMOSCoinc>("AGATAVAMOSCoinc","Check some coincidences spectra between VAMOS and AGATA");
#endif
*/
fd->Add<KeyWatcher>("Merger_Keys","AgataKeys Watcher at the merger level",trig);
ok = true;
}
// TRACKING Level //
if ( DFtype.Contains("TRACKING") && !DFtype.Contains("TRACKING_DB")) {
if ( DFtype.Contains("TRACKING")) {
bool EventDataConfiguration = true;
......@@ -259,59 +247,23 @@ Bool_t SetupWatchers(const char *df_type, FrameDispatcher *fd, const char *ext =
fd->SetTrigger(TriggerTracking);
fd->Add<TrackingWatcher>("Tracking","Display Agata spectra at the tracking level",TriggerTracking);
// VertexInterface *vertex = VertexBuilder::theCurrentVertexBuilder()->GetVertex();
// vertex->SetPosition (0, 0, 0);
// vertex->SetBeta(0.0963);
fd->Add<KeyWatcher>("Tracking_Keys","AgataKeys Watcher at the tracking level",TriggerTracking);
fd->Add<KeyWatcher>("All_Keys","Universal AgataKeys Watcher",UnivTrig);
ok = true;
}
// TRACKING Level //
if ( DFtype.Contains("TRACKING_DB") ) {
bool EventDataConfiguration = true;
AgataFrameTrigger *TriggerTracking = 0x0;
AgataFrameTrigger *UnivTrig = GetUniversalTrigger();
#ifdef HAS_VAMOS
if(EventDataConfiguration)
TriggerTracking = AgataFrameTrigger::Build("TRACKING", "event:data data:ranc0 event:data:psa data:tracked");
else
TriggerTracking= AgataFrameTrigger::Build("TRACKING", "data:tracked");
#else
if(EventDataConfiguration)
TriggerTracking = AgataFrameTrigger::Build("TRACKING", "event:data event:data:psa data:tracked");
else
TriggerTracking= AgataFrameTrigger::Build("TRACKING", "data:tracked");
#endif
fd->SetTrigger(TriggerTracking);
fd->Add<KeyWatcher>("All_Keys","Universal AgataKeys Watcher",UnivTrig);
AgataFrameTrigger *VamosOnly = AgataFrameTrigger::Build("TRACKING", "event:data data:ranc0 !event:data:psa !data:tracked");
AgataFrameTrigger *AgataOnly = AgataFrameTrigger::Build("TRACKING", "event:data !data:ranc0 event:data:psa data:tracked");
fd->Add<KeyWatcher>("Tracking_Keys_Normal","AgataKeys Watcher at the tracking level",TriggerTracking);
fd->Add<KeyWatcher>("Tracking_Keys_Vamos","AgataKeys Watcher at the tracking level",VamosOnly);
fd->Add<KeyWatcher>("Tracking_Keys_AGATA","AgataKeys Watcher at the tracking level",AgataOnly);
ok = true;
}
#ifdef WITH_MFM
if ( DFtype.Contains("NEDAB") ) {
// define WatcherClient for a specific trigger
// it defines a trigger on an ancilary frame
AgataFrameTrigger *trig =
AgataFrameTrigger::Build("NEDAB", "event:data:ranc0");
AgataFrameTrigger::Build("NEDAB", "event:data:ranc0");
fd->SetTrigger(trig);
TTreeMaster *rootmaster = fd->Add<TTreeMaster>("TreeMaster","Own the tree");
rootmaster->Add<EventNEDATree>("NEDA","See Spectra in Out/VAMOS_Spectra.root");
// TTreeMaster *rootmaster = fd->Add<TTreeMaster>("TreeMaster","Own the tree");
// rootmaster->Add<EventNEDATree>("NEDA","See Spectra in Out/NEDA_Spectra.root");
fd->Add<KeyWatcher>("NEDA_Keys","AgataKeys Watcher for the ancilary level");
fd->Add<EventNEDASpectra>("NEDASpectra","AgataKeys Watcher for the ancilary level");
......@@ -323,17 +275,18 @@ Bool_t SetupWatchers(const char *df_type, FrameDispatcher *fd, const char *ext =
// define WatcherClient for a specific trigger
// it defines a trigger on an ancilary frame
AgataFrameTrigger *trig =
AgataFrameTrigger::Build("DIAMANTB", "event:data:ranc1");
AgataFrameTrigger::Build("DIAMANTB", "event:data:ranc1");
fd->SetTrigger(trig);
TTreeMaster *rootmaster = fd->Add<TTreeMaster>("TreeMaster","Own the tree");
rootmaster->Add<EventDIAMANTTree>("DIAMANT","See Spectra in Out/DIAMANT_Spectra.root");
// TTreeMaster *rootmaster = fd->Add<TTreeMaster>("TreeMaster","Own the tree");
// rootmaster->Add<EventDIAMANTTree>("DIAMANT","See Spectra in Out/DIAMANT_Spectra.root");
fd->Add<KeyWatcher>("DIAMANT_Keys","AgataKeys Watcher for the ancilary level");
fd->Add<EventNEDASpectra>("DIAMANTSpectra","AgataKeys Watcher for the ancilary level");
ok = true;
}
#endif
return ok;
......
......@@ -85,14 +85,54 @@ void Import(TString Incl, TString Excl, TString DefaultPath)
if(gSystem->AccessPathName(DataPath))
{
cout<<DataPath<<" no readable, looking in the Out Dir"<<endl;
DataPath.ReplaceAll("/Data/","/Out/");
if(gSystem->AccessPathName(DataPath))
cout<<DataPath<<"Data dir no readable, looking in the Out Dir"<<endl;
}
else
{
Dir.SetDirectory(DataPath);
TList *ListOfSubFolders = Dir.GetListOfFiles();
ListOfSubFolders->Remove(ListOfSubFolders->FindObject(".")); // Pour supprimer /.
ListOfSubFolders->Remove(ListOfSubFolders->FindObject(".."));
TIter iter(ListOfSubFolders);
TObject *entry;
while ( (entry = iter()) )
{
TString SubDirName = entry->GetName();
TString SubDirPath = DataPath + SubDirName;
if(entry->InheritsFrom("TSystemDirectory"))
{
cout<<DataPath<<" no readable, exit"<<endl;
return;
TSystemDirectory SubDir;
SubDir.SetDirectory(SubDirPath);
TList *ListOfFiles = SubDir.GetListOfFiles();
ListOfFiles->Remove(ListOfFiles->FindObject(".")); // Pour supprimer /.
ListOfFiles->Remove(ListOfFiles->FindObject("..")); // Pour supprimer /..
if(ListOfFiles->IsEmpty()) ListOfSubFolders->Remove(entry);
else
{
TList *ListOfSpectra = GetListFromIncExcl(ListOfFiles,Incl,Excl);
ListOfSpectra->SetName(SubDirName);
ListOfCrystals->Add(ListOfSpectra);
}
}
}
}
DataPath = Path + "/Out/";
if(gSystem->AccessPathName(DataPath))
{
cout<<DataPath<<"Out dir no readable"<<endl;
}
else
{
Dir.SetDirectory(DataPath);
TList *ListOfSubFolders = Dir.GetListOfFiles();
......@@ -126,6 +166,13 @@ void Import(TString Incl, TString Excl, TString DefaultPath)