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

Add security on the number of subframes


git-svn-id: svn+ssh://anonsvn.in2p3.fr/agata/gammaware/trunk@2249 c3abf467-7ff2-0310-b516-c5fb849bdde0
parent ce97f87c
......@@ -163,6 +163,17 @@ void EventDIAMANTTree::Exec(Option_t * /*option*/)
UInt_t number_of_frame = GetNbSubFrame(); nbDIAMANT = number_of_frame;
if(nbDIAMANT>MaxDIAMANT)
{
fBashColor->SetWarningOut();
cout<<GetName()<<endl;
cout<<number_of_frame<<" sub frames in event:data:ranc1 ==> maximum is "<<MaxDIAMANT<<endl;
cout<<"Event ignored"<<endl;
fBashColor->ResetColor();
return;
}
for(UInt_t i = 0u; i <number_of_frame; i++) {
MFMDiamantFrame *mfmframe = GetMFM(i);
if ( mfmframe == 0x0 ){
......
......@@ -24,6 +24,7 @@
// Watcher definition
#include "Watchers.h"
#include "TTreeWatchers.h"
#include "BashColor.h"
// ADF definitions
#include "AgataRawFrame.h"
......@@ -48,7 +49,8 @@ using namespace Gw;
*/
class EventDIAMANTWatchers : public WatcherWithTag
{
protected:
BashColor *fBashColor;
protected:
//! current data:ranc0 frame to help decoding one by one
Frame *fSubFrame;
......@@ -66,6 +68,7 @@ protected:
public:
EventDIAMANTWatchers(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 MFMDiamantFrame()),
fFrame(0x0)
......@@ -107,7 +110,7 @@ public:
class EventDIAMANTTree : public EventDIAMANTWatchers, public TTreeBuilder
{
static const Int_t MaxDIAMANT = 100;
static const Int_t MaxDIAMANT = 96; //6 boards * 16 channels
private:
Int_t nbDIAMANT; // Number of hits in the array
......
......@@ -167,6 +167,17 @@ void EventNEDATree::Exec(Option_t * /*option*/)
UInt_t number_of_frame = GetNbSubFrame(); nbNEDA = number_of_frame;
if(nbNEDA>MaxNEDA)
{
fBashColor->SetWarningOut();
cout<<GetName()<<endl;
cout<<number_of_frame<<" sub frames in event:data:ranc0 ==> maximum is "<<MaxNEDA<<endl;
cout<<"Event ignored"<<endl;
fBashColor->ResetColor();
return;
}
for(UInt_t i = 0u; i <number_of_frame; i++)
{
MFMNedaFrame *mfmframe = GetMFM(i);
......
......@@ -24,6 +24,7 @@
// Watcher definition
#include "Watchers.h"
#include "TTreeWatchers.h"
#include "BashColor.h"
// ADF definitions
#include "AgataRawFrame.h"
......@@ -48,7 +49,8 @@ using namespace Gw;
*/
class EventNEDAWatchers : public WatcherWithTag
{
protected:
BashColor *fBashColor;
protected:
//! current data:ranc0 frame to help decoding one by one
Frame *fSubFrame;
......@@ -66,6 +68,7 @@ protected:
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()),
fFrame(0x0)
......@@ -107,7 +110,7 @@ public:
class EventNEDATree : public EventNEDAWatchers, public TTreeBuilder
{
static const Int_t MaxNEDA = 196;
static const Int_t MaxNEDA = 128; //8 boards * 16 channels
private:
Int_t nbNEDA; // Number of hits in the array
......
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