Commit 8762aea3 authored by Vratislav Chudoba's avatar Vratislav Chudoba

Initial commit

parents
# =============================================================================
cmake_minimum_required(VERSION 3.5)
# Give your project a name
project(go4_5H_processor)
# Switch in on for more verbose make output
# set(CMAKE_VERBOSE_MAKEFILE ON)
# =============================================================================
# External packages
# See: https://root.cern.ch/how/integrate-root-my-project-cmake
# ROOT
list(APPEND CMAKE_PREFIX_PATH $ENV{ROOTSYS})
find_package(ROOT REQUIRED)
# Define useful ROOT functions and macros (e.g. ROOT_GENERATE_DICTIONARY)
include(${ROOT_USE_FILE})
# Go4
if (DEFINED ENV{GO4SYS})
message("Go4 found at $ENV{GO4SYS}")
include_directories($ENV{GO4SYS}/include)
link_directories($ENV{GO4SYS}/lib)
else()
message(FATAL_ERROR "Go4 not found! Please, run go4login or define the GO4SYS env. variable.")
endif()
# =============================================================================
#if (CMAKE_COMPILER_IS_GNUCXX)
# set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -g -Wall -Wextra -Wpedantic")
# # -std=c++11
#endif()
# =============================================================================
add_subdirectory(src)
#!/bin/bash
./doclean.sh
if [ ! -d "build" ]; then
mkdir build
fi
cd build
cmake ../
make -j
cd -
#cp -v build/src/*.so .
#cp -v build/src/*.pcm .
#cp -v build/src/*.rootmap .
ln -s build/src/libUserAnalysis.so
ln -s build/src/libUserAnalysis_rdict.pcm
ln -s build/src/libUserAnalysis.rootmap
echo -e "\e[1m\e[32mCompilation finished.\e[0m"
#!/bin/bash
#rm -fv libUserAnalysis.so libUserAnalysis_rdict.pcm libUserAnalysis.rootmap
unlink libUserAnalysis.so
unlink libUserAnalysis_rdict.pcm
unlink libUserAnalysis.rootmap
rm -fv out.txt err.txt
rm -fv summary.txt
rm -fv Go4AnalysisASF.root
if [ -d "build" ]; then
rm -rf build/*
fi
echo -e "\e[1m\e[32mCleanup finished.\e[0m"
#!/bin/bash
# Order matters!
#SOFTDIR=/home/evovch/soft
#export ERSYS=${SOFTDIR}/er
#export ERBUILD=${SOFTDIR}/er_build
#cd ${ERBUILD}/
#. ./config.sh
#cd -
#cd ${SOFTDIR}/go4-5.3.0_fairsoftroot/
#. ./go4login
#cd -
#cd ${SOFTDIR}/FairSoft_install/bin/
#. ./thisroot.sh
#cd -
void rcall(const char* name)
{
TNeDet1 *pDet
= (TNeDet1*)(TGo4Analysis::Instance())->GetParameter(name);
if(!pDet)
{
printf("OBJECT: %s WAS NOT FOUND \n",name);
return;
}
TString fname(name);
fname.ToLower();
fname += ".cal";
pDet->Read(fname.Data());
}
{
TString myGO4SYS = gSystem->Getenv("GO4SYS");
if (myGO4SYS == "") {
cerr << "GO4SYS environment variable not defined. "
<< "Please run go4login or define GO4SYS manually. " << endl
<< "Only $GO4SYS/include path will be passed to the ROOT interpreter."
<< endl;
return;
}
gInterpreter->AddIncludePath(myGO4SYS + "/include/");
}
#!/bin/bash
#INPUTFILE=/home/evovch/Downloads/FLNR_data/h5_14_0001.lmd
#INPUTFILE=/home/vratik/data/exp1804/h5_12_0001.lmd
INPUTFILE=/home/vratik/data/exp1804/h5_14_09.lml
rm -fv output.root
rm -fv Go4AnalysisASF.root
rm -fv out.txt err.txt
echo -e "\e[1m\e[32mAnalysis started.\e[0m"
#TODO check that GO4SYS is declared
#${GO4SYS}/bin/go4analysis -v -lib libUserAnalysis.so -number 100000 -asf Go4AnalysisASF.root -file ${INPUTFILE} > out.txt 2> err.txt
${GO4SYS}/bin/go4analysis -v -lib libUserAnalysis.so -asf Go4AnalysisASF.root -file ${INPUTFILE} > out.txt 2> err.txt
# -number 1000
echo -e "\e[1m\e[32mAnalysis finished.\e[0m"
#!/bin/bash
if [ -z ${PATH+x} ]; then echo "PATH is unset";
else echo "PATH is set to:"; echo $'\t'"${PATH//:/$'\n\t'}"; fi
if [ -z ${ROOTSYS+x} ]; then echo "ROOTSYS is unset";
else echo "ROOTSYS is set to '$ROOTSYS'"; fi
if [ -z ${SIMPATH+x} ]; then echo "SIMPATH is unset";
else echo "SIMPATH is set to '$SIMPATH'"; fi
if [ -z ${FAIRROOTPATH+x} ]; then echo "FAIRROOTPATH is unset";
else echo "FAIRROOTPATH is set to '$FAIRROOTPATH'"; fi
if [ -z ${LD_LIBRARY_PATH+x} ]; then echo "LD_LIBRARY_PATH is unset";
else echo "LD_LIBRARY_PATH is set to:"; echo $'\t'"${LD_LIBRARY_PATH//:/$'\n\t'}"; fi
if [ -z ${GO4SYS+x} ]; then echo "GO4SYS is unset";
else echo "GO4SYS is set to '$GO4SYS'"; fi
# =============================================================================
# ROOT dictionary
# Normally this is not needed, but rootcling cannot see these files
# if the current source directory (which is 'PROJECTBASEDIR/src' in our case)
# is not added to the include_directories list.
include_directories(${CMAKE_CURRENT_SOURCE_DIR})
set(ROOTCLING_HEADERS TNeAnalysis.h
TNeDet16.h
TNeEvent.h
TNeMParms.h
TNeProc.h
TNeSel.h
)
ROOT_GENERATE_DICTIONARY(G__UserAnalysis ${ROOTCLING_HEADERS} LINKDEF NeLinkDef.h)
# =============================================================================
set(SOURCE_LIB G__UserAnalysis.cxx
TNeAnalysis.cxx
TNeDet16.cxx
TNeEvent.cxx
TNeMParms.cxx
TNeProc.cxx
TNeSel.cxx
)
add_library(UserAnalysis SHARED ${SOURCE_LIB})
target_link_libraries(UserAnalysis Go4Analysis)
#ifdef __CINT__
#pragma link off all globals;
#pragma link off all classes;
#pragma link off all functions;
#pragma link C++ class TNeAnalysis+;
#pragma link C++ class TNeDet16+;
#pragma link C++ class TNeEvent+;
#pragma link C++ class TNeMParms+;
#pragma link C++ class TNeProc+;
#pragma link C++ class TNeSel+;
#endif
//===================================================================
//== TNeAnalysis.cxx: exp0211
//== Version: 2011-02-01
//===================================================================
#include "TNeAnalysis.h"
#include <stdlib.h>
#include "Riostream.h"
#include "Go4EventServer.h"
#include "TGo4StepFactory.h"
#include "TGo4AnalysisStep.h"
#include "TNeDet16.h"
//#include "TNeH1Parms.h"
//#include "TNeH2Parms.h"
#include "TNeMParms.h"
#include "TNeSel.h"
#include "TGo4Version.h"
#include "TGo4MbsEventServer.h"
//***********************************************************
TNeAnalysis::TNeAnalysis()
:fMbsEvent(0)
,fEvents(0)
,fLastEvent(0)
,pSQX_L_EC(0)
,pSQY_L_EC(0)
,pSQX_R_EC(0)
,pSQY_R_EC(0)
,pANR_EC(0)
,pANS_EC(0)
,pCsI_L_EC(0)
,pCsI_R_EC(0)
,pSQ20_EC(0)
,pMTracks(0)
{
}
//***********************************************************
// this constructor is called by go4analysis executable
TNeAnalysis::TNeAnalysis(int argc, char** argv)
:TGo4Analysis(argc, argv)
,fMbsEvent(0)
,fEvents(0)
,fLastEvent(0)
,pSQX_L_EC(0)
,pSQY_L_EC(0)
,pSQX_R_EC(0)
,pSQY_R_EC(0)
,pANR_EC(0)
,pANS_EC(0)
,pCsI_L_EC(0)
,pCsI_R_EC(0)
,pSQ20_EC(0)
,pMTracks(0)
{
cout << "**** Create TNeAnalysis name: " << argv[0] << endl;
if (!TGo4Version::CheckVersion(__GO4BUILDVERSION__)) {
cout << "**** Go4 version mismatch" << endl;
exit(-1);
}
TGo4StepFactory* factory = new TGo4StepFactory("Factory");
factory->DefEventProcessor("NeProc","TNeProc");// object name, class name
factory->DefOutputEvent("NeEvent","TNeEvent"); // object name, class name
// TGo4EventSourceParameter* sourcepar = new TGo4MbsEventServerParameter("rio3");
TGo4EventSourceParameter* sourcepar = new TGo4MbsStreamParameter("lipc-1");
//TGo4EventSourceParameter* sourcepar = new TGo4MbsTransportParameter("rio3");
// TGo4EventSourceParameter* sourcepar =
// new TGo4MbsFileParameter("/LynxOS/RIO3_3.1/mbsusr/user1/mbsrun/flnr/wrk3a/aa*.lmd");
TGo4FileStoreParameter* storepar = new TGo4FileStoreParameter("output.root");
storepar->SetOverwriteMode(kTRUE);
TGo4AnalysisStep* step = new TGo4AnalysisStep("Analysis", factory, sourcepar, storepar);
step->SetSourceEnabled(kTRUE);
step->SetStoreEnabled(kTRUE);
step->SetProcessEnabled(kTRUE);
step->SetErrorStopEnabled(kTRUE);
// Now the first analysis step is set up.
// Other steps could be created here
AddAnalysisStep(step);
// uncomment following line to define custom passwords for analysis server
// DefineServerPasswords("Neadmin", "Nectrl", "Neview");
DefineServerPasswords("Acu0La0", "Acu0La0", "go4view");
//////////////// Parameter //////////////////////////
// At this point, autosave file has not yet been read!
// Therefore parameter values set here will be overwritten
// if an autosave file is there.
pSQX_L_EC = new TNeDet16("SQX_L_EC");
AddParameter(pSQX_L_EC);
pSQY_L_EC = new TNeDet16("SQY_L_EC");
AddParameter(pSQY_L_EC);
pSQX_R_EC = new TNeDet16("SQX_R_EC");
AddParameter(pSQX_R_EC);
pSQY_R_EC = new TNeDet16("SQY_R_EC");
AddParameter(pSQY_R_EC);
pANR_EC = new TNeDet16("ANR_EC");
AddParameter(pANR_EC);
pANS_EC = new TNeDet16("ANS_EC");
AddParameter(pANS_EC);
pCsI_L_EC = new TNeDet16("CsI_L_EC");
AddParameter(pCsI_L_EC);
pCsI_R_EC = new TNeDet16("CsI_R_EC");
AddParameter(pCsI_R_EC);
pSQ20_EC = new TNeDet16("SQ20_EC");
AddParameter(pSQ20_EC);
pMTracks = new TNeMParms("MTRACKS");
AddParameter(pMTracks);
}
//***********************************************************
TNeAnalysis::~TNeAnalysis()
{
cout << "**** TNeAnalysis: Delete instance" << endl;
}
//-----------------------------------------------------------
Int_t TNeAnalysis::UserPreLoop()
{
// all this is optional:
cout << "**** TNeAnalysis: PreLoop" << endl;
// get pointer to input event (used in postloop and event function):
fMbsEvent = dynamic_cast<TGo4MbsEvent*> (GetInputEvent("Analysis")); // of step "Analysis"
if(fMbsEvent) {
// fileheader structure (lmd file only):
s_filhe* fileheader=fMbsEvent->GetMbsSourceHeader();
if(fileheader)
{
cout <<"\nInput file: "<<fileheader->filhe_file << endl;
cout <<"Tapelabel:\t" << fileheader->filhe_label<<endl;
cout <<"UserName:\t" << fileheader->filhe_user<<endl;
cout <<"RunID:\t" << fileheader->filhe_run<<endl;
cout <<"Explanation: "<<fileheader->filhe_exp <<endl;
cout <<"Comments: "<<endl;
Int_t numlines=fileheader->filhe_lines;
for(Int_t i=0; i<numlines;++i)
{
cout<<"\t"<<fileheader->s_strings[i].string << endl;
}
}
}
fEvents=0; // event counter
fLastEvent=0; // number of last event processed
pSQX_L_EC->ReadData();
pSQY_L_EC->ReadData();
pSQX_R_EC->ReadData();
pSQY_R_EC->ReadData();
pANR_EC->ReadData();
pANS_EC->ReadData();
pCsI_L_EC->ReadData();
pCsI_R_EC->ReadData();
pSQ20_EC->ReadData();
return 0;
}
//-----------------------------------------------------------
Int_t TNeAnalysis::UserPostLoop()
{
// all this is optional:
cout << "**** TNeAnalysis: PostLoop" << endl;
cout << "Last event #: " << fLastEvent << " Total events: " << fEvents << endl;
fMbsEvent = 0; // reset to avoid invalid pointer if analysis is changed in between
fEvents=0;
return 0;
}
//-----------------------------------------------------------
Int_t TNeAnalysis::UserEventFunc()
{
// all this is optional:
// This function is called once for each event after all steps.
if(fMbsEvent) {
fEvents++;
fLastEvent=fMbsEvent->GetCount();
}
if(fEvents == 1 || IsNewInputFile()) {
cout << "First event #: " << fLastEvent << endl;
SetNewInputFile(kFALSE); // we have to reset the newfile flag
}
return 0;
}
//===================================================================
//== TNeAnalysis.h: exp1210
//== Version: 2010-11-12
//===================================================================
#ifndef TNeANALYSIS_H
#define TNeANALYSIS_H
#include "TGo4Analysis.h"
#include "TGo4WinCond.h"
class TGo4MbsEvent;
class TNeDet16;
class TNeMParms;
class TNeSel;
class TNeAnalysis : public TGo4Analysis
{
private:
TGo4MbsEvent* fMbsEvent;
Int_t fEvents;
Int_t fLastEvent;
public:
TNeAnalysis();
TNeAnalysis(int argc, char** argv);
virtual ~TNeAnalysis() ;
virtual Int_t UserPreLoop();
virtual Int_t UserEventFunc();
virtual Int_t UserPostLoop();
TNeDet16* pSQX_L_EC;
TNeDet16* pSQY_L_EC;
TNeDet16* pSQX_R_EC;
TNeDet16* pSQY_R_EC;
TNeDet16* pANR_EC;
TNeDet16* pANS_EC;
TNeDet16* pCsI_L_EC;
TNeDet16* pCsI_R_EC;
TNeDet16* pSQ20_EC;
TNeMParms* pMTracks;
ClassDef(TNeAnalysis,1)
};
#endif //TANALYSIS_H
//===================================================================
//== TNeDet16.cpp: exp0211
//== Version: 2011-02-01
//===================================================================
#include "TNeDet16.h"
#include <stdio.h>
#include "Riostream.h"
using std::cout;
using std::endl;
const int mchan = 16;
const int m = 3;
//***********************************************************
TNeDet16::TNeDet16(const char* name)
:TGo4Parameter(name)
,kread(0)
,n(2)
,nchan(mchan)
{
for(int i = 0; i < mchan; ++i)
{
a[i][0] = 0.;
a[i][1] = 1.;
a[i][2] = 0.;
}
} //----------------------------------------------------------------
TNeDet16::~TNeDet16()
{
} //-----------------------------------------------------------------
Bool_t TNeDet16::UpdateFrom(TGo4Parameter *source)
{
cout << "**** TNeDet1 " << GetName()
<< " updated from auto save file" << endl;
TNeDet16 * from = dynamic_cast<TNeDet16 *>(source);
if(from==0)
{
cout << "Wrong parameter class: "
<< source->ClassName() << endl;
return kFALSE;
}
kread = from->kread;
switch(kread)
{
case 1:
kread = 0;
from->kread = 0;
ReadData();
from->n = n;
from->nchan = nchan;
for(int i = 0; i < mchan; ++i)
{
from->a[i][0] = a[i][0];
from->a[i][1] = a[i][1];
from->a[i][2] = a[i][2];
}
break;
default:
n = from->n;
nchan = from->n;
for(int i =0; i < mchan; ++i)
{
a[i][0] = from->a[i][0];
a[i][1] = from->a[i][1];
a[i][2] = from->a[i][2];
}
}
return kTRUE;
} //-----------------------------------------------------------------
void TNeDet16::ReadData()
{
TString xname = GetName();
xname.ToLower();
xname += ".clb";
FILE* F = fopen(xname.Data(),"rt");
if(!F)
{
printf("\n\n!!! FILE: %s WAS NOT FOUND\n\n"
,xname.Data());
return;
}
fscanf(F,"%d%d",&n,&nchan);
for(int i=0; i<nchan; i++)
{
fscanf(F,"%lf%lf%lf",&a[i][0],&a[i][1],&a[i][2]);
}
printf("\n\nREAD DATA FROM FILE: %s\n\n",xname.Data());
fclose(F);
return;
} //-----------------------------------------------------------------
double TNeDet16::Energy(double value, int chan)
{
double res = a[chan][n-1];
for(int i = n-2; i >= 0 ; --i)
{
res = res * value + a[chan][i];
}
return res;
} //-----------------------------------------------------------------
//===================================================================
//== TNeDet1.h: exp0211
//== Version: 2011-02-01
//===================================================================
#ifndef TNeDet16_H
#define TNeDet16_H
#include "TGo4Parameter.h"
class TNeDet16 : public TGo4Parameter
{
public:
TNeDet16(const char* name = 0);
virtual ~TNeDet16();
virtual Bool_t UpdateFrom(TGo4Parameter *);
void ReadData();
double Energy(double value, int chan);
int kread;
int n;
int nchan;
double a[32][3];
ClassDef(TNeDet16,1)
};
#endif
//===================================================================
//== TNeEvent.cxx:
//== Version:
//===================================================================
#include "TNeEvent.h"
#include "Riostream.h"
using std::cout;
using std::endl;
TNeEvent::TNeEvent()
:TGo4EventElement()
{
cout << "**** TNeEvent: Create instance" << endl;
} //-------------------------------------------------------------------
TNeEvent::TNeEvent(const char* name)
:TGo4EventElement(name)
{
cout << "**** TNeEvent: Create instance " << name << endl;
} //-------------------------------------------------------------------
TNeEvent::~TNeEvent()
{
cout << "**** TNeEvent: Delete instance " << endl;
} //-------------------------------------------------------------------
void TNeEvent::Clear(Option_t *t)
{
//==================================================================
//== all members should be cleared.
//== memset(fRawData,0, sizeof(fRawData));
//==================================================================
memset(CsI_L, 0, sizeof(CsI_L));
memset(CsI_R, 0, sizeof(CsI_R));
memset(tCsI_L, 0, sizeof(tCsI_L));
memset(tCsI_R, 0, sizeof(tCsI_R));
memset(SQX_L, 0, sizeof(SQX_L));
memset(tSQX_L, 0, sizeof(tSQX_L));
memset(SQY_L, 0, sizeof(SQY_L));
memset(tSQY_L, 0, sizeof(tSQY_L));
memset(SQX_R, 0, sizeof(SQX_R));
memset(tSQX_R, 0, sizeof(tSQX_R));
memset(SQY_R, 0, sizeof(SQY_R));
memset(SQ20, 0, sizeof(SQ20));
memset(tSQ20, 0, sizeof(tSQ20));
memset(SQY_R, 0, sizeof(SQY_R));
memset(tSQY_R, 0, sizeof(tSQY_R));
memset(ANR, 0, sizeof(ANR));
memset(ANS, 0, sizeof(ANS));
memset(F3, 0, sizeof(F3));
memset(tF3, 0, sizeof(tF3));
memset(F5, 0, sizeof(F5));
memset(tF5, 0, sizeof(tF5));
memset(F6, 0, sizeof(F6));
memset(tF6, 0, sizeof(tF6));
memset(tMWPC, 0, sizeof(tMWPC));
/*
memset(ADC, 0, sizeof(ADC));
memset(TDC, 0, sizeof(TDC));
memset(mQDC, 0, sizeof(mQDC));
memset(mTDC, 0, sizeof(mTDC));
*/
memset(neutAmp, 0, sizeof(neutAmp));
memset(neutTAC, 0, sizeof(neutTAC));
memset(neutTDC, 0, sizeof(neutTDC));
nevent = 0;
trigger = 0;
subevents = 0;
evsize = 0;
// time = 0;
} //-------------------------------------------------------------------
//===================================================================
//== TNeEvent.h:
//== Version:
//===================================================================
#ifndef TNeEVENT_H
#define TNeEVENT_H
#include "TGo4EventElement.h"
class TNeEvent : public TGo4EventElement
{
public:
TNeEvent();
TNeEvent(const char* name);
virtual ~TNeEvent();
/** Method called by the framework to clear the event element. */
void Clear(Option_t *t="");
unsigned short CsI_L[16];
unsigned short tCsI_L[16];
unsigned short CsI_R[16];
unsigned short tCsI_R[16];
unsigned short SQX_L[32];
unsigned short tSQX_L[32];
unsigned short SQY_L[16];
unsigned short tSQY_L[16];
unsigned short SQX_R[32];
unsigned short tSQX_R[32];
unsigned short SQY_R[16];
unsigned short SQ20[16];
unsigned short tSQ20[16];
unsigned short tSQY_R[16];
unsigned short ANR[16];
unsigned short ANS[16];
unsigned short neutAmp[32];
unsigned short neutTAC[32];
unsigned short neutTDC[32];
unsigned short F3[4];
unsigned short tF3[4];
unsigned short F5[4];
unsigned short tF5[4];
unsigned short F6[4];
unsigned short tF6[4];
unsigned short tMWPC[4];
unsigned int scaler[16];
unsigned int mtime;
/* unsigned short ADC[32];
unsigned short TDC[32];
unsigned short mQDC[32];
unsigned short mTDC[32];
*/
//WIRES
unsigned short nx1, ny1, nx2, ny2; // wires
unsigned short x1[32],y1[32],x2[32],y2[32]; // wires
unsigned int rx1, rx2, ry1, ry2;
int nevent;
int trigger;
int subevents;
int evsize;
// unsigned int time;
ClassDef(TNeEvent,1)
};
#endif //TEVENT_H
//===================================================================
//== TNe1HParms.cpp: exp1210
//== Version: 2010-11-26
//===================================================================
#include "TNeMParms.h"
#include "Riostream.h"
using std::cout;
using std::endl;
//const int mchan = 32;
//const int m = 3;
//***********************************************************
TNeMParms::TNeMParms(const char* name)
:TGo4Parameter(name),
fill(kTRUE)
{
} //----------------------------------------------------------------
TNeMParms::~TNeMParms()
{
} //-----------------------------------------------------------------
Bool_t TNeMParms::UpdateFrom(TGo4Parameter *source)
{
cout << "**** TNeHParm " << GetName()
<< " updated from auto save file" << endl;
TNeMParms * from = dynamic_cast<TNeMParms *>(source);
if(from==0)
{
cout << "Wrong parameter class: "
<< source->ClassName() << endl;
return kFALSE;
}
fill = from->fill;
mtracksx = from->mtracksx;
mtracksy = from->mtracksy;
return kTRUE;
} //-----------------------------------------------------------------
//===================================================================
//== TNeMParms.h: exp1210
//== Version: 2010-11-1226
//===================================================================
#ifndef TNeMPARMS_H
#define TNeMPARMS_H
#include "TGo4Parameter.h"
class TNeMParms : public TGo4Parameter
{
public:
TNeMParms(const char* name = 0);
virtual ~TNeMParms();
virtual Bool_t UpdateFrom(TGo4Parameter *);
Bool_t fill;
int mtracksx,mtracksy;
ClassDef(TNeMParms,1)
};
#endif
This diff is collapsed.
#ifndef TUNPACKPROCESSOR_H
#define TUNPACKPROCESSOR_H
#include <TLine.h>
#include <TGraph.h>
#include <TGraphErrors.h>
#include "TGo4EventProcessor.h"
//class TNeParam;
extern int otl;
class TNeProc : public TGo4EventProcessor
{
public:
TNeProc() ;
TNeProc(const char* name);
virtual ~TNeProc() ;
Bool_t BuildEvent(TGo4EventElement* target); // event processing function
double GetClasters(unsigned short n, unsigned short *x);
static long bit[32];
private:
TH1 *fTrigger;
TH1 *fSubEvents;
TH1 *fEventsSizes;
// RAW
// CsI
TH1 *d1CsI_L[16];
TH1 *d1CsI_R[16];
TH1 *d1tCsI_L[16];
TH1 *d1tCsI_R[16];
// Si LEFT
TH1 *d1SQX_L[32];
TH1 *d1SQY_L[16];
TH1 *d1tSQX_L[32];
TH1 *d1tSQY_L[16];
TH1 *d1SQ20[16];
TH1 *d1tSQ20[16];
// Si RIGHT
TH1 *d1SQX_R[32];
TH1 *d1SQY_R[16];
TH1 *d1tSQX_R[32];
TH1 *d1tSQY_R[16];
// ToF + MWPC + ANNULAR
TH1 *d1ANR[16];
TH1 *d1ANS[16];
TH1 *d1F3[4];
TH1 *d1tF3[4];
TH1 *d1F5[4];
TH1 *d1tF5[4];
TH1 *d1F6[4];
TH1 *d1tF6[4];
TH1 *d1tMWPC[4];
//
//
TH1 *d1ToF;
TH1 *d1aF3;
TH2 *d2ToFaF3;
TH1 *d1aF5;
TH2 *d2ToFaF5;
//
TH2 *d2tF3aF3_L;
TH2 *d2tF3aF3_R;
TH2 *d2tF3aF3_U;
TH2 *d2tF3aF3_D;
TH2 *d2SQXSQY_L_D;
TH1 *d1nSQX_L;
TH1 *d1nSQY_L;
TH1 *d1mSQX_L;
TH1 *d1mSQY_L;
TH1 *d1nSQ20;
TH2 *d2SQXSQY_R_D;
TH1 *d1nSQX_R;
TH1 *d1nSQY_R;
TH1 *d1mSQX_R;
TH1 *d1mSQY_R;
TH2 *d2dE_E_L[16];
TH2 *d2dE_E_R[16];
//
TH2 *d2dE_E_L_c[16];
TH2 *d2dE_E_R_c[16];
//
TH2 *d2SQ20_SQY_L;
//CALIBRATED
TH1 *d1ESQX_L;
TH1 *d1ESQX_R;
TH1 *d1SQX_L_C[32];
TH1 *d1SQY_L_C[16];
TH1 *d1SQX_R_C[32];
TH1 *d1SQY_R_C[16];
TH1 *d1ANR_C[16];
TH1 *d1ANS_C[16];
TH1 *d1CsI_L_C[16];
TH1 *d1CsI_R_C[16];
TH1 *d1SQ20_C[16];
//neutrons
TH1 *d1neutAmp[32];
TH1 *d1neutTAC[32];
TH1 *d1neutTDC[32];
TH2 *d2Ngamma[32];
//WIRES
TH1 *d1X1;
TH1 *d1Y1;
TH1 *d1X2;
TH1 *d1Y2;
TH1 *d1NX1;
TH1 *d1NY1;
TH1 *d1NX2;
TH1 *d1NY2;
TH2 *d2XY1;
TH2 *d2XY2;
TH1 *d1CX1;
TH1 *d1CY1;
TH1 *d1CX2;
TH1 *d1CY2;
TH2 *d2Target;
TGo4Picture *fPTrackX;
TGraph *fTracksX;
TLine *fLWAX1;
TLine *fLWAX2;
TLine *fLWAX3;
TGo4Picture *fPTrackY;
TGraph *fTracksY;
TLine *fLWBX1;
TLine *fLWBX2;
TLine *fLWBX3;
int ntrackx,ntracky;
int itrackAX;
int itrackBX;
double a,dx,dx1,dx2,dy1,dy2,dtx,dty;
double pxa0, pxa1, pxa2, pxa3, pxa4;
double CsI_L_calib_cont[16], CsI_R_calib_cont[16];
double pxb0, pxb1, pxb2, pxb3, pxb4;
double pya1, pya2, pya3;
double pyb1, pyb2, pyb3;
double ya1, ya2, ya3;
double yb1, yb2, yb3;
ClassDef(TNeProc,1)
};
#endif //TUNPACKPROCESSOR_H
//===================================================================
//== TNeSel.cxx: exp0211
//== Version: 2011-03-01
//===================================================================
#include "TNeSel.h"
#include "Riostream.h"
using std::cout;
using std::endl;
//***********************************************************
TNeSel::TNeSel(const char* name)
:TGo4Parameter(name)
,lval(0.)
,uval(4096.)
{
;
} //----------------------------------------------------------------
TNeSel::~TNeSel()
{
} //-----------------------------------------------------------------
Bool_t TNeSel::UpdateFrom(TGo4Parameter *source)
{
cout << "**** TNeDet1 " << GetName()
<< " updated from auto save file" << endl;
TNeSel * from = dynamic_cast<TNeSel *>(source);
if(from==0)
{
cout << "Wrong parameter class: "
<< source->ClassName() << endl;
return kFALSE;
}
lval = from->lval;
uval = from->uval;
return kTRUE;
} //-----------------------------------------------------------------
int TNeSel::CheckValue(double val)
{
if(val > lval && val < uval) return 1;
return 0;
} //-----------------------------------------------------------------
//===================================================================
//== TNeSel.h: exp0211
//== Version: 2011-03-01
//===================================================================
#ifndef TNeSEL_H
#define TNeSEL_H
#include "TGo4Parameter.h"
class TNeSel : public TGo4Parameter
{
public:
TNeSel(const char* name = 0);
virtual ~TNeSel();
virtual Bool_t UpdateFrom(TGo4Parameter *);
int CheckValue(double val);
double lval;
double uval;
ClassDef(TNeSel,1)
};
#endif
int idCsI_L[16][32] = {
{ 3, 3, 3, 3, 3, 3, 3, 3, 2, 2, 2, 2, 2, 2, 2, 2, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0},
{ 3, 3, 3, 3, 3, 3, 3, 3, 2, 2, 2, 2, 2, 2, 2, 2, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0},
{ 3, 3, 3, 3, 3, 3, 3, 3, 2, 2, 2, 2, 2, 2, 2, 2, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0},
{ 3, 3, 3, 3, 3, 3, 3, 3, 2, 2, 2, 2, 2, 2, 2, 2, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0},
{ 7, 7, 7, 7, 7, 7, 7, 7, 6, 6, 6, 6, 6, 6, 6, 6, 5, 5, 5, 5, 5, 5, 5, 5, 4, 4, 4, 4, 4, 4, 4, 4},
{ 7, 7, 7, 7, 7, 7, 7, 7, 6, 6, 6, 6, 6, 6, 6, 6, 5, 5, 5, 5, 5, 5, 5, 5, 4, 4, 4, 4, 4, 4, 4, 4},
{ 7, 7, 7, 7, 7, 7, 7, 7, 6, 6, 6, 6, 6, 6, 6, 6, 5, 5, 5, 5, 5, 5, 5, 5, 4, 4, 4, 4, 4, 4, 4, 4},
{ 7, 7, 7, 7, 7, 7, 7, 7, 6, 6, 6, 6, 6, 6, 6, 6, 5, 5, 5, 5, 5, 5, 5, 5, 4, 4, 4, 4, 4, 4, 4, 4},
{ 11,11,11,11,11,11,11,11,10,10,10,10,10,10,10,10, 9, 9, 9, 9, 9, 9, 9, 9, 8, 8, 8, 8, 8, 8, 8, 8},
{ 11,11,11,11,11,11,11,11,10,10,10,10,10,10,10,10, 9, 9, 9, 9, 9, 9, 9, 9, 8, 8, 8, 8, 8, 8, 8, 8},
{ 11,11,11,11,11,11,11,11,10,10,10,10,10,10,10,10, 9, 9, 9, 9, 9, 9, 9, 9, 8, 8, 8, 8, 8, 8, 8, 8},
{ 11,11,11,11,11,11,11,11,10,10,10,10,10,10,10,10, 9, 9, 9, 9, 9, 9, 9, 9, 8, 8, 8, 8, 8, 8, 8, 8},
{ 15,15,15,15,15,15,15,15,14,14,14,14,14,14,14,14,13,13,13,13,13,13,13,13,12,12,12,12,12,12,12,12},
{ 15,15,15,15,15,15,15,15,14,14,14,14,14,14,14,14,13,13,13,13,13,13,13,13,12,12,12,12,12,12,12,12},
{ 15,15,15,15,15,15,15,15,14,14,14,14,14,14,14,14,13,13,13,13,13,13,13,13,12,12,12,12,12,12,12,12},
{ 15,15,15,15,15,15,15,15,14,14,14,14,14,14,14,14,13,13,13,13,13,13,13,13,12,12,12,12,12,12,12,12}};
int idCsI_R[16][32] = {
{ 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 2, 2, 2, 2, 2, 2, 2, 2, 3, 3, 3, 3, 3, 3, 3, 3},
{ 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 2, 2, 2, 2, 2, 2, 2, 2, 3, 3, 3, 3, 3, 3, 3, 3},
{ 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 2, 2, 2, 2, 2, 2, 2, 2, 3, 3, 3, 3, 3, 3, 3, 3},
{ 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 2, 2, 2, 2, 2, 2, 2, 2, 3, 3, 3, 3, 3, 3, 3, 3},
{ 4, 4, 4, 4, 4, 4, 4, 4, 5, 5, 5, 5, 5, 5, 5, 5, 6, 6, 6, 6, 6, 6, 6, 6, 7, 7, 7, 7, 7, 7, 7, 7},
{ 4, 4, 4, 4, 4, 4, 4, 4, 5, 5, 5, 5, 5, 5, 5, 5, 6, 6, 6, 6, 6, 6, 6, 6, 7, 7, 7, 7, 7, 7, 7, 7},
{ 4, 4, 4, 4, 4, 4, 4, 4, 5, 5, 5, 5, 5, 5, 5, 5, 6, 6, 6, 6, 6, 6, 6, 6, 7, 7, 7, 7, 7, 7, 7, 7},
{ 4, 4, 4, 4, 4, 4, 4, 4, 5, 5, 5, 5, 5, 5, 5, 5, 6, 6, 6, 6, 6, 6, 6, 6, 7, 7, 7, 7, 7, 7, 7, 7},
{ 8, 8, 8, 8, 8, 8, 8, 8, 9, 9, 9, 9, 9, 9, 9, 9,10,10,10,10,10,10,10,10,11,11,11,11,11,11,11,11},
{ 8, 8, 8, 8, 8, 8, 8, 8, 9, 9, 9, 9, 9, 9, 9, 9,10,10,10,10,10,10,10,10,11,11,11,11,11,11,11,11},
{ 8, 8, 8, 8, 8, 8, 8, 8, 9, 9, 9, 9, 9, 9, 9, 9,10,10,10,10,10,10,10,10,11,11,11,11,11,11,11,11},
{ 8, 8, 8, 8, 8, 8, 8, 8, 9, 9, 9, 9, 9, 9, 9, 9,10,10,10,10,10,10,10,10,11,11,11,11,11,11,11,11},
{ 12,12,12,12,12,12,12,12,13,13,13,13,13,13,13,13,14,14,14,14,14,14,14,14,15,15,15,15,15,15,15,15},
{ 12,12,12,12,12,12,12,12,13,13,13,13,13,13,13,13,14,14,14,14,14,14,14,14,15,15,15,15,15,15,15,15},
{ 12,12,12,12,12,12,12,12,13,13,13,13,13,13,13,13,14,14,14,14,14,14,14,14,15,15,15,15,15,15,15,15},
{ 12,12,12,12,12,12,12,12,13,13,13,13,13,13,13,13,14,14,14,14,14,14,14,14,15,15,15,15,15,15,15,15} };
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