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