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

Adding a TreeWatcher for not builded neda frames



git-svn-id: svn+ssh://anonsvn.in2p3.fr/agata/gammaware/trunk@2251 c3abf467-7ff2-0310-b516-c5fb849bdde0
parent a71c7dd2
......@@ -188,7 +188,6 @@ GuiBuildTree::GuiBuildTree(const TGWindow *p, UInt_t w, UInt_t h) :
MainFrame->AddFrame(fVFRight, new TGLayoutHints(kLHintsExpandX | kLHintsExpandY));
/// Top right side : ADF part
TGHorizontalFrame *fH3 = new TGHorizontalFrame(fVFRight, 10, 50, kFixedHeight);
fVFRight->AddFrame(fH3, new TGLayoutHints(kLHintsTop | kLHintsExpandX));
......@@ -328,9 +327,16 @@ void GuiBuildTree::PrintConfig()
if(fUseNEDA)
{
if(fTriggerName.Contains("event:data:ranc0"))
PrintInListBox(fResumeBox,"Neda data stored",kPrint);
{
PrintInListBox(fResumeBox,"Event Neda data stored",kPrint);
fUseEventNEDA = true;
}
else
{
PrintInListBox(fResumeBox,"Neda data stored ==> Trigger does not contain event:data:ranc0",kWarning);
PrintInListBox(fResumeBox,"Neda data stored ==> NEDATree will be used instead of EventNEDATree",kWarning);
fUseEventNEDA = false;
}
}
else
PrintInListBox(fResumeBox,"No NEDA data",kError);
......@@ -493,11 +499,14 @@ void GuiBuildTree::ProcessRun(int RunIndex)
#ifdef WITH_MFM
if(fUseNEDA)
{
rootmaster->Add<EventNEDATree>("NEDA","Neda branch");
if(fUseEventNEDA)
rootmaster->Add<EventNEDATree>("EVENT_NEDA","Event Neda branch");
else
rootmaster->Add<NEDATree>("NEDA","Neda branch");
}
if(fUseDIAMANT)
{
rootmaster->Add<EventDIAMANTTree>("DIAMANT","DIAMANT branch");
rootmaster->Add<EventDIAMANTTree>("EVENT_DIAMANT","Event DIAMANT branch");
}
#endif
......
......@@ -35,6 +35,7 @@
#include "BashColor.h"
#ifdef WITH_MFM
#include "NEDAWatchers.h"
#include "EventNEDAWatchers.h"
#include "EventDIAMANTWatchers.h"
#endif
......@@ -135,6 +136,7 @@ class GuiBuildTree : public TGMainFrame
bool fUseVAMOS;
bool fUseNEDA;
bool fUseEventNEDA;
bool fUseDIAMANT;
bool fUseVertexBuilder;
int fVAMOSMode;
......
......@@ -196,10 +196,10 @@ void EventDIAMANTTree::Exec(Option_t * /*option*/)
BoardId[i] = mfmframe->GetBoardId();
ChannelId[i] = mfmframe->GetTGCristalId() ;
Status1[i] = GetStatus(0);
Status2[i] = GetStatus(1);
Energy[i] = GetEnergy();
Top[i] = GetTop();
Status1[i] = mfmframe->GetStatus(0);
Status2[i] = mfmframe->GetStatus(1);
Energy[i] = mfmframe->GetEnergy();
Top[i] = mfmframe->GetTop();
}
FillTree();
......
......@@ -67,7 +67,7 @@ UInt_t EventNEDAWatchers::GetNbSubFrame()
return 0u;
}
MFMNedaFrame *EventNEDAWatchers::GetMFM(UInt_t which)
MFMNedaCompFrame *EventNEDAWatchers::GetMFM(UInt_t which)
{
// does not exist
if ( !(which < GetNbSubFrame()) ) {
......@@ -116,7 +116,7 @@ void EventNEDASpectra::Exec(Option_t * /*option*/)
fFold->Fill(nb_frames);
for(UInt_t i = 0u; i <nb_frames; i++) {
MFMNedaFrame *mfmframe = GetMFM(i);
MFMNedaCompFrame *mfmframe = GetMFM(i);
if ( mfmframe == 0x0 ){
std::cout << "BUG" << std::endl;
continue;
......@@ -188,7 +188,7 @@ void EventNEDATree::Exec(Option_t * /*option*/)
for(UInt_t i = 0u; i <nbNEDA; i++)
{
MFMNedaFrame *mfmframe = GetMFM(i);
MFMNedaCompFrame *mfmframe = GetMFM(i);
if ( mfmframe == 0x0 ){
std::cout << "BUG" << std::endl;
continue;
......@@ -197,10 +197,10 @@ void EventNEDATree::Exec(Option_t * /*option*/)
BoardId[i] = mfmframe->GetBoardId();
ChannelId[i] = mfmframe->GetChannelId() ;
NEDATdc[i] = mfmframe->GetTdcValue();
NEDATdc[i] = mfmframe->GetTdcCorValue();
NEDAFast[i] = mfmframe->GetFastIntegral();
NEDASlow[i] = mfmframe->GetSlowIntegral();
NEDAZco[i] = mfmframe->GetZcoInterval();
NEDAZco[i] = mfmframe->GetNbZero();
}
FillTree();
......
......@@ -33,7 +33,7 @@
#include "Rtypes.h"
// MFM
#include "MFMNedaFrame.h"
#include "MFMNedaCompFrame.h"
class TH1F;
......@@ -54,7 +54,7 @@ protected:
protected:
//! current data:ranc0 frame to help decoding one by one
Frame *fSubFrame;
MFMNedaFrame *fMFMFrame;
MFMNedaCompFrame *fMFMFrame;
protected:
//! main frame i.e. event:data:ranc0
......@@ -63,14 +63,14 @@ protected:
protected:
//! number of sub Frames extracted from the current event
UInt_t GetNbSubFrame();
MFMNedaFrame *GetMFM(UInt_t i);
MFMNedaCompFrame *GetMFM(UInt_t i);
public:
EventNEDAWatchers(const char *name, const char *title, TDirectory *sp_dir = 0x0, TDirectory *tag_dir = 0x0) :
WatcherWithTag(name,title,sp_dir,tag_dir),
fBashColor(new BashColor()),
fSubFrame(0x0),
fMFMFrame(new MFMNedaFrame()),
fMFMFrame(new MFMNedaCompFrame()),
fFrame(0x0)
{;}
virtual ~EventNEDAWatchers()
......
......@@ -33,7 +33,7 @@ using namespace ADF;
NEDAWatchers::NEDAWatchers(const char *name, const char *title, TDirectory *sp_dir, TDirectory *tag_dir) :
WatcherWithTag(name,title,sp_dir,tag_dir),
fBashColor(new BashColor()),
fMFMFrame(new MFMNedaFrame()),
fMFMFrame(new MFMNedaCompFrame()),
fFrame(0x0)
{
memset(fStatPerBoard, 0, sizeof(UInt_t)*MaxNEDA*(MaxChannel+1));
......@@ -49,7 +49,7 @@ Bool_t NEDAWatchers::SetTrigger( ADF::DFTrigger *trigger )
return fFrame != 0x0;
}
MFMNedaFrame *NEDAWatchers::GetMFM()
MFMNedaCompFrame *NEDAWatchers::GetMFM()
{
// cannot read the data
if( fFrame->GetFrame()->Read() == 0 ) {
......@@ -68,7 +68,7 @@ void NEDAWatchers::Exec(Option_t * /*option*/)
return;
}
MFMNedaFrame *mfmframe = GetMFM();
MFMNedaCompFrame *mfmframe = GetMFM();
fADFTimestamp = ((AgataKey *)fFrame->GetFrame()->GetKey())->GetTimeStamp();
fMFMTimestamp = mfmframe->GetTimeStamp();
......@@ -133,5 +133,70 @@ void NEDASpectra::Exec(Option_t * /*option*/)
}
NEDATree::NEDATree(const char *name, const char *title, TTree *tree) :
NEDAWatchers(name,title),
TTreeBuilder(name,title,tree)
{
if ( GetTree() ) { // just add the branch for that watcher
SetBranches();
}
// create spetra
}
NEDATree::~NEDATree()
{
}
void NEDATree::SetBranches()
{
GetTree()->Branch("NEDABoard", &BoardId, "BoardId/s" );
GetTree()->Branch("NEDAChannel", &ChannelId, "ChannelId/s" );
GetTree()->Branch("NEDATdc", &NEDATdc, "NEDATdc/s" );
GetTree()->Branch("NEDAFast", &NEDAFast, "NEDAFast/s" );
GetTree()->Branch("NEDASlow", &NEDASlow, "NEDASlow/s" );
GetTree()->Branch("NEDAZco", &NEDAZco, "NEDAZco/s" );
GetTree()->Branch("TSNEDA", &fTimestamp, "TSNeda/l" );
}
void NEDATree::Exec(Option_t * /*option*/)
{
if ( fFrame == 0x0 || !fFrame->IsValid() ) {
SetLastExecStatus(1u);
return;
}
BoardId = 0;
ChannelId = 0;
NEDATdc = 0;
NEDAFast = 0;
NEDASlow = 0;
NEDAZco = 0;
fTimestamp = ((AgataKey *)fFrame->GetFrame()->GetKey())->GetTimeStamp();
MFMNedaCompFrame *mfmframe = GetMFM();
if ( mfmframe == 0x0 ){
std::cout << "BUG" << std::endl;
return;
}
BoardId = mfmframe->GetBoardId();
ChannelId = mfmframe->GetChannelId() ;
NEDATdc = mfmframe->GetTdcCorValue();
NEDAFast = mfmframe->GetFastIntegral();
NEDASlow = mfmframe->GetSlowIntegral();
NEDAZco = mfmframe->GetNbZero();
FillTree();
}
ClassImp(NEDAWatchers)
ClassImp(NEDASpectra)
ClassImp(NEDATree)
......@@ -33,7 +33,7 @@
#include "Rtypes.h"
// MFM
#include "MFMNedaFrame.h"
#include "MFMNedaCompFrame.h"
class TH1F;
......@@ -60,11 +60,11 @@ protected:
//! main frame i.e. data:ranc0
SharedFP *fFrame = 0x0;
//! current data:ranc0 frame to help decoding one by one
MFMNedaFrame *fMFMFrame = 0x0;
MFMNedaCompFrame *fMFMFrame = 0x0;
protected:
//! number of sub Frames extracted from the current event
MFMNedaFrame *GetMFM();
MFMNedaCompFrame *GetMFM();
protected:
ULong64_t fADFTimestamp;
......@@ -116,7 +116,26 @@ public:
ClassDef(NEDASpectra,0)
};
class NEDATree : public NEDAWatchers, public TTreeBuilder
{
private:
UShort_t BoardId, ChannelId;
UShort_t NEDATdc, NEDAFast, NEDASlow ,NEDAZco;
ULong64_t fTimestamp;
protected:
virtual void SetBranches();
public:
NEDATree(const char *name, const char *title, TTree *tree = 0x0);
virtual ~NEDATree();
//! watch the current frame
virtual void Exec(Option_t *option="");
ClassDef(NEDATree,0) // built a root tree for the neda comp part
};
#endif
......@@ -256,6 +256,7 @@ void LoadWatchers_ANCILLARIES()
gROOT->ProcessLine(tmp.Data());
}
LoadClass(Form("DefaultWatchers/%s/NEDAWatchers.C",CAMPAIGN.Data()));
LoadClass(Form("DefaultWatchers/%s/EventNEDAWatchers.C",CAMPAIGN.Data()));
LoadClass(Form("DefaultWatchers/%s/EventDIAMANTWatchers.C",CAMPAIGN.Data()));
......
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