Commit ec9cb2af authored by Jérémie Dudouet's avatar Jérémie Dudouet
Browse files

Adapt FIPPSSpy to new LUT and to Labr3 and TAC

parent 278e9f6a
Pipeline #54875 passed with stage
in 7 minutes and 53 seconds
......@@ -12,8 +12,8 @@ class TH1;
class FSMainWindow;
enum CanvasTypes{ kFIPPS, kFIPPS_ACF, kFIPPS_ACS, kFIPPS_ACB, kIFIN, kIFIN_AC, kTAG, kUndef};
static const TString fNames[8] = {"FIPPS","FIPPS_AC_FRONT","FIPPS_AC_SIDE","FIPPS_AC_BACK","IFIN","IFIN_AC","TAG","Undef"};
enum CanvasTypes{ kFIPPS, kFIPPS_ACF, kFIPPS_ACS, kFIPPS_ACB, kIFIN, kIFIN_AC, kTAG, kLaBr3, kTAC, kUndef};
static const TString fNames[10] = {"FIPPS","FIPPS_AC_FRONT","FIPPS_AC_SIDE","FIPPS_AC_BACK","IFIN","IFIN_AC","TAG","LaBr3","TAC","Undef"};
class FSGlobalCanvas : public TGHorizontalFrame
{
......
......@@ -560,16 +560,17 @@ void FSMainWindow::ReadLUT()
if(Buffer.BeginsWith("#") || Buffer.Length()==0 ) continue;
TObjArray *loa=Buffer.ReplaceAll("\t"," ").Tokenize(" ");
if(loa->GetEntries() != 5) {
if(loa->GetEntries() != 8) {
ERR_MESS<<"Error in LUT.txt at line "<<linenb<<" ; skipped"<<ENDL;
delete loa;
continue;
}
Int_t adcval = ((TString)loa->At(0)->GetName()).Atoi();
Int_t globdetid = ((TString)loa->At(1)->GetName()).Atoi();
Int_t detid = ((TString)loa->At(2)->GetName()).Atoi();
Int_t type = ((TString)loa->At(3)->GetName()).Atoi();
Int_t clover = ((TString)loa->At(4)->GetName()).Atoi();
Int_t globdetid = ((TString)loa->At(4)->GetName()).Atoi();
Int_t detid = ((TString)loa->At(3)->GetName()).Atoi();
Int_t type = ((TString)loa->At(1)->GetName()).Atoi();
Int_t clover = ((TString)loa->At(2)->GetName()).Atoi();
delete loa;
if(globdetid<0) continue;
......@@ -580,6 +581,7 @@ void FSMainWindow::ReadLUT()
det->adc = adcval;
det->Id = detid;
det->GlobId = globdetid;
det->CloverId = clover;
for(int i=0 ; i<10 ; i++) {
if(i==1) fListOfCal[globdetid][i] = 1.;
......@@ -723,34 +725,43 @@ void FSMainWindow::ReadHistograms()
DetDef *det = fDetectors[adc];
if(det->IsFIPPS()) {
type = CanvasTypes::kFIPPS;
DetNum = det->Id;
DetNum = det->CloverId*4+det->Id;
}
else if(det->IsIFIN()) {
type = CanvasTypes::kIFIN;
DetNum = det->Id;
DetNum = det->CloverId*4+det->Id;
}
else if(det->IsTAG()) {
type = CanvasTypes::kTAG;
DetNum = det->Id;
DetNum = det->CloverId;
}
else if(det->IsAC()) {
if(det->Type == 3) {
type = CanvasTypes::kIFIN_AC;
DetNum = det->Id;
DetNum = det->CloverId;
}
else if(det->Type == 5) {
else if(det->Type == 3 && det->Id==0) {
type = CanvasTypes::kFIPPS_ACB;
DetNum = det->Id/3;
DetNum = det->CloverId*3+det->Id;
}
else if(det->Type == 6) {
else if(det->Type == 3 && det->Id==1) {
type = CanvasTypes::kFIPPS_ACF;
DetNum = det->Id/3;
DetNum = det->CloverId*3+det->Id;
}
else if(det->Type == 7) {
else if(det->Type == 3 && det->Id==2) {
type = CanvasTypes::kFIPPS_ACS;
DetNum = det->Id/3;
DetNum = det->CloverId*3+det->Id;
}
}
else if(det->IsLaBr3()) {
type = CanvasTypes::kLaBr3;
DetNum = det->CloverId;
}
else if(det->IsTAC()) {
type = CanvasTypes::kTAC;
DetNum = det->CloverId;
}
TString HistName = Form("ADC%d_%s_%d",adc,fNames[type].Data(),DetNum);
if(fListOfSpectra.count(id)==0) {
......
......@@ -35,11 +35,13 @@ public:
public:
DetDef(){;}
Bool_t IsTAG(){return Type==4;}
Bool_t IsAC(){return (Type==3 || Type==5 || Type==6 || Type==7);}
Bool_t IsTAG(){return Type==5;}
Bool_t IsAC(){return (Type==3 || Type==4);}
Bool_t IsIFIN(){return Type==2;}
Bool_t IsFIPPS(){return Type==1;}
Bool_t IsClover(){return IsFIPPS() || IsIFIN();}
Bool_t IsLaBr3() {return Type==6;}
Bool_t IsTAC() {return Type==7;}
};
class FSMainWindow : public TGMainFrame
......
......@@ -33,7 +33,18 @@ FSShutter::FSShutter(const TGWindow *p, const TGWindow *m, UInt_t options) :
fTAGShutteritem = new TGShutterItem(this, new TGHotString("TAG"), id);
fTAGShutteritem->ChangeSubframesBackground(FS_LightBlue);
((TGCompositeFrame*)fTAGShutteritem->GetContainer())->ChangeSubframesBackground(FS_Snow);
AddItem(fTAGShutteritem);}
AddItem(fTAGShutteritem);
id = 4000;
fLaBr3Shutteritem = new TGShutterItem(this, new TGHotString("LaBr3"), id);
fLaBr3Shutteritem->ChangeSubframesBackground(FS_LightBlue);
((TGCompositeFrame*)fLaBr3Shutteritem->GetContainer())->ChangeSubframesBackground(FS_Snow);
AddItem(fLaBr3Shutteritem);
id = 5000;
fTACShutteritem = new TGShutterItem(this, new TGHotString("TAC"), id);
fTACShutteritem->ChangeSubframesBackground(FS_LightBlue);
((TGCompositeFrame*)fTACShutteritem->GetContainer())->ChangeSubframesBackground(FS_Snow);
AddItem(fTACShutteritem);
}
FSShutter::~FSShutter()
{
......@@ -48,6 +59,8 @@ void FSShutter::GetType(TH1 *hist, CanvasTypes &Type, Int_t &Num)
delete arr;
Type = CanvasTypes::kUndef;
if(name.Contains(fNames[kTAG])) Type = kTAG;
else if(name.Contains(fNames[kLaBr3])) Type = kLaBr3;
else if(name.Contains(fNames[kTAC])) Type = kTAC;
else if(name.Contains(fNames[kFIPPS_ACB])) Type = kFIPPS_ACB;
else if(name.Contains(fNames[kFIPPS_ACF])) Type = kFIPPS_ACF;
else if(name.Contains(fNames[kFIPPS_ACS])) Type = kFIPPS_ACS;
......@@ -110,6 +123,25 @@ FSGlobalCanvas* FSShutter::NewGlobalCanvas(CanvasTypes type)
container->AddFrame(c,new TGLayoutHints(kLHintsCenterY | kLHintsExpandX, 5, 20, 0, 0));
}
}
else if(type==CanvasTypes::kLaBr3) {
if(fListOfCanvas->FindObject(fNames[type]) == nullptr) {
container = (TGCompositeFrame*)fLaBr3Shutteritem->GetContainer();
c = new FSGlobalCanvas(container,fMain,type);
fListOfCanvas->Add(c);
c->ChangeSubframesBackground(FS_LightRed);
container->AddFrame(c,new TGLayoutHints(kLHintsCenterY | kLHintsExpandX, 5, 20, 0, 0));
}
}
else if(type==CanvasTypes::kTAC) {
if(fListOfCanvas->FindObject(fNames[type]) == nullptr) {
container = (TGCompositeFrame*)fTACShutteritem->GetContainer();
c = new FSGlobalCanvas(container,fMain,type);
fListOfCanvas->Add(c);
c->ChangeSubframesBackground(FS_LightRed);
container->AddFrame(c,new TGLayoutHints(kLHintsCenterY | kLHintsExpandX, 5, 20, 0, 0));
}
}
fMain->GetLeftTab()->MapSubwindows();
fMain->GetLeftTab()->MapWindow();
......
......@@ -17,10 +17,15 @@ private:
TGShutterItem *fFIPPSShutteritem = nullptr;
TGShutterItem *fIFINShutteritem = nullptr;
TGShutterItem *fTAGShutteritem = nullptr;
TGShutterItem *fLaBr3Shutteritem = nullptr;
TGShutterItem *fTACShutteritem = nullptr;
TGShutter *fFIPPSShutter = nullptr;
TGShutter *fIFINShutter = nullptr;
TGShutter *fTAGShutter = nullptr;
TGShutter *fLaBr3Shutter = nullptr;
TGShutter *fTACShutter = nullptr;
TList *fListOfCanvas = nullptr;
TList *fListOfShutteritem=nullptr;
......
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