Commit 756eb644 authored by Pavel Sharov's avatar Pavel Sharov

* update crate config.

parent ec74e750
# Go4 library for ACCULINNA2 experiments
## 24e01
### Naming conventions
- prefix T[number]x is for telescope
- By default channel 1--16 for X-strips 16--32 for Y.
/* -*- mode:c++ c-file-style:"linux" -*- */
//===================================================================
//== TNeEvent.cxx:
//== Version:
//== Version:
//===================================================================
using namespace std;
#include "TNeEvent.h"
#include "Riostream.h"
#include <algorithm>
TNeEvent::TNeEvent()
TNeEvent::TNeEvent()
:TGo4EventElement()
{
cout << "**** TNeEvent: Create instance" << endl;
} //-------------------------------------------------------------------
TNeEvent::TNeEvent(const char* name)
TNeEvent::TNeEvent(const char* name)
:TGo4EventElement(name)
{
cout << "**** TNeEvent: Create instance " << name << endl;
......@@ -26,45 +29,51 @@ TNeEvent::~TNeEvent()
void TNeEvent::Clear(Option_t *t)
{
//==================================================================
//== all members should be cleared.
//== memset(fRawData,0, sizeof(fRawData));
//==================================================================
//==================================================================
//== all members should be cleared.
//== memset(fRawData,0, sizeof(fRawData));
//==================================================================
// Si
memset(Lxa, 0, sizeof(Lxa));
memset(Lxt, 0, sizeof(Lxt));
memset(Lya, 0, sizeof(Lya));
memset(Lyt, 0, sizeof(Lyt));
memset(Rxa, 0, sizeof(Rxa));
memset(Rxt, 0, sizeof(Rxt));
memset(Rya, 0, sizeof(Rya));
memset(Ryt, 0, sizeof(Ryt));
memset(RVa, 0, sizeof(RVa));
memset(RVt, 0, sizeof(RVt));
memset(R60a, 0, sizeof(R60a));
memset(R60t, 0, sizeof(R60t));
memset(AnSa, 0, sizeof(AnSa));
memset(AnSt, 0, sizeof(AnSt));
memset(AnRa, 0, sizeof(AnRa));
memset(AnRt, 0, sizeof(AnRt));
memset(AnVa, 0, sizeof(AnVa));
memset(AnVt, 0, sizeof(AnVt));
memset(Lxa, 0, sizeof(Lxa));
memset(Lxt, 0, sizeof(Lxt));
memset(Lya, 0, sizeof(Lya));
memset(Lyt, 0, sizeof(Lyt));
memset(Rxa, 0, sizeof(Rxa));
memset(Rxt, 0, sizeof(Rxt));
memset(Rya, 0, sizeof(Rya));
memset(Ryt, 0, sizeof(Ryt));
memset(RVa, 0, sizeof(RVa));
memset(RVt, 0, sizeof(RVt));
memset(R20a, 0, sizeof(R20a));
memset(R20t, 0, sizeof(R20t));
memset(AnSa, 0, sizeof(AnSa));
memset(AnSt, 0, sizeof(AnSt));
memset(AnRa, 0, sizeof(AnRa));
memset(AnRt, 0, sizeof(AnRt));
memset(AnVa, 0, sizeof(AnVa));
memset(AnVt, 0, sizeof(AnVt));
std::fill_n(Rcsa,16,0);
std::fill_n(Rcst,16,0);
std::fill_n(Lcsa,16,0);
std::fill_n(Lcst,16,0);
// ToF
memset(F3, 0, sizeof(F3));
memset(tF3, 0, sizeof(tF3));
memset(F5, 0, sizeof(F5));
memset(tF5, 0, sizeof(tF5));
memset(F3, 0, sizeof(F3));
memset(tF3, 0, sizeof(tF3));
memset(F5, 0, sizeof(F5));
memset(tF5, 0, sizeof(tF5));
// MWPC
memset(tMWPC, 0, sizeof(tMWPC));
memset(tMWPC, 0, sizeof(tMWPC));
nevent = 0;
trigger = 0;
subevents = 0;
evsize = 0;
evsize = 0;
mtime = 0;
} //-------------------------------------------------------------------
/* -*- mode:c++ c-file-style:"linux" -*- */
//===================================================================
//== TNeEvent.h:
//== Version:
......@@ -29,14 +30,18 @@ public:
unsigned short Ryt[16];
unsigned short RVa[16];
unsigned short RVt[16];
unsigned short R60a[16];
unsigned short R60t[16];
unsigned short R20a[16];
unsigned short R20t[16];
unsigned short AnSa[16];
unsigned short AnSt[16];
unsigned short AnRa[16];
unsigned short AnRt[16];
unsigned short AnVa[16];
unsigned short AnVt[16];
unsigned short Rcsa[16];
unsigned short Rcst[16];
unsigned short Lcsa[16];
unsigned short Lcst[16];
unsigned short F3[4];
unsigned short tF3[4];
......
......@@ -22,7 +22,7 @@ using namespace std;
#include "TGo4Picture.h"
#include "TGo4MbsEvent.h"
#include "snprintf.h"
#include "TNeEvent.h"
#include "TNeDet16.h"
#include "TNeAnalysis.h"
......@@ -109,7 +109,7 @@ TNeProc::~TNeProc()
} //-------------------------------------------------------------------
TNeProc::TNeProc(const char* name) : TGo4EventProcessor(name)
{
{
TGo4Log::Info("**** TNeProc: Create instance %s", name);
fTrigger = MakeTH1('I', "Trigger", "Values of trigger", 16, 0., 15.);
fSubEvents = MakeTH1('I', "SubEvents", "Number of subevents", 16, 0, 15);
......@@ -117,48 +117,73 @@ TNeProc::TNeProc(const char* name) : TGo4EventProcessor(name)
int i;
for (i = 0; i < 16; ++i) {
//-----SQ telescope raw-----
d1Lxa[i] = MakeTH1('I', Form("Lxa/Lxas_%2.2d",i) //указывать не повторяющуюся структуру папок и уникальные имена
d1Lxa[i] = MakeTH1('I', Form("Lxa/Lxas_%2.2d",i) //указывать не повторяющуюся структуру папок и уникальные имена
, Form("L x amp CH %2.2d",i), 8192, 0., 8192.);
d1Lxt[i] = MakeTH1('I', Form("Lxt/Lxts_%2.2d",i)
, Form("L x time CH %2.2d",i), 4096, 1., 4096);
d1Lxc[i] = MakeTH1('D', Form("Lxc/Lxcs_%2.2d",i)
, Form("L x energy MeV %2.2d",i), 4000, -2., 98.);
//
d1Lya[i] = MakeTH1('I', Form("Lya/Lyas_%2.2d",i) //указывать не повторяющуюся структуру папок и уникальные имена
d1Lya[i] = MakeTH1('I', Form("Lya/Lyas_%2.2d",i) //указывать не повторяющуюся структуру папок и уникальные имена
, Form("L x amp CH %2.2d",i), 8192, 0., 8192.);
d1Lyt[i] = MakeTH1('I', Form("Lyt/Lyts_%2.2d",i)
, Form("L x time CH %2.2d",i), 4096, 1, 4096);
d1Lyc[i] = MakeTH1('D', Form("Lyc/Lycs_%2.2d",i)
//
, Form("L x energy MeV %2.2d",i), 4000, -2., 98.);
d1Rxa[i] = MakeTH1('I', Form("Rxa/Rxas_%2.2d",i) //указывать не повторяющуюся структуру папок и уникальные имена
d1Rxa[i] = MakeTH1('I', Form("Rxa/Rxas_%2.2d",i) //указывать не повторяющуюся структуру папок и уникальные имена
, Form("R x amp CH %2.2d",i), 8192, 0., 8192.);
d1Rxt[i] = MakeTH1('I', Form("Rxt/Rxts_%2.2d",i)
, Form("R x time CH %2.2d",i), 4096, 1., 4096);
d1Rxc[i] = MakeTH1('D', Form("Rxc/Rxcs_%2.2d",i)
, Form("R x energy MeV %2.2d",i), 4000, -2., 98.);
//
d1Rya[i] = MakeTH1('I', Form("Rya/Ryas_%2.2d",i) //указывать не повторяющуюся структуру папок и уникальные имена
d1Rya[i] = MakeTH1('I', Form("Rya/Ryas_%2.2d",i) //указывать не повторяющуюся структуру папок и уникальные имена
, Form("R x amp CH %2.2d",i), 8192, 0., 8192.);
d1Ryt[i] = MakeTH1('I', Form("Ryt/Ryts_%2.2d",i)
, Form("R x time CH %2.2d",i), 4096, 1, 4096);
d1Ryc[i] = MakeTH1('D', Form("Ryc/Rycs_%2.2d",i)
, Form("R x energy MeV %2.2d",i), 4000, -2., 98.);
//
d1AnSa[i] = MakeTH1('I', Form("AnSa/AnSas_%2.2d",i) //указывать не повторяющуюся структуру папок и уникальные имена
d1AnSa[i] = MakeTH1('I', Form("AnSa/AnSas_%2.2d",i) //указывать не повторяющуюся структуру папок и уникальные имена
, Form("Sect amp CH %2.2d",i), 8192, 0., 8192.);
d1AnSt[i] = MakeTH1('I', Form("AnSt/AnSts_%2.2d",i)
, Form("Sect time CH %2.2d",i), 4096, 1, 4096);
d1AnSc[i] = MakeTH1('D', Form("AnSc/AnScs_%2.2d",i)
, Form("Sect energy MeV %2.2d",i), 4000, -2., 98.);
//
d1AnRa[i] = MakeTH1('I', Form("AnRa/AnRas_%2.2d",i) //указывать не повторяющуюся структуру папок и уникальные имена
d1AnRa[i] = MakeTH1('I', Form("AnRa/AnRas_%2.2d",i) //указывать не повторяющуюся структуру папок и уникальные имена
, Form("Ring amp CH %2.2d",i), 8192, 0., 8192.);
d1AnRt[i] = MakeTH1('I', Form("AnRt/AnRts_%2.2d",i)
, Form("Ring time CH %2.2d",i), 4096, 1, 4096);
d1AnRc[i] = MakeTH1('D', Form("AnRc/AnRcs_%2.2d",i)
, Form("Ring energy MeV %2.2d",i), 4000, -2., 98.);
}
for (int i = 0; i < 16; ++i) {
d1Lcsa[i] = MakeTH1('I', Form("Lcsa/Lcsa_%02d",i),
Form("Lcs amp CH %02d",i), 4096, 0., 4096);
d1Lcst[i] = MakeTH1('I', Form("Lcst/Lcst_%02d",i)
, Form("Lcs time CH %02d",i), 4096, 1., 4095);
d1Lcsc[i] = MakeTH1('D', Form("Lcsc/Lcsc_%02d",i),
Form("Lcs energy MeV %2.2d",i), 4000, -2., 98.);
}
for (int i = 0; i < 16; ++i) {
d1Rcsa[i] = MakeTH1('I', Form("Rcsa/Rcsa_%02d",i),
Form("Rcs amp CH %02d",i), 4096, 0., 4096);
d1Rcst[i] = MakeTH1('I', Form("Rcst/Rcst_%02d",i)
, Form("Rcs time CH %02d",i), 4096, 1., 4095);
d1Rcsc[i] = MakeTH1('D', Form("Rcsc/Rcsc_%02d",i),
Form("Rcs energy MeV %2.2d",i), 4000, -2., 98.);
}
for (int i = 0; i < 16; ++i) {
d1R20a[i] = MakeTH1('I', Form("R20a/R20a_%02d",i),
Form("R20 amp CH %02d",i), 4096, 0., 4096);
d1R20t[i] = MakeTH1('I', Form("R20t/R20t_%02d",i)
, Form("R20 time CH %02d",i), 4096, 1., 4095);
d1R20c[i] = MakeTH1('D', Form("R20c/R20c_%02d",i),
Form("R20 energy MeV %2.2d",i), 4000, -2., 98.);
}
//
d1F3[0] = MakeTH1('I',"F3/QDC/F3_QDC_L","F3 QDC left", 4096, 0., 4095.);
d1F3[1] = MakeTH1('I',"F3/QDC/F3_QDC_R","F3 QDC right", 4096, 0., 4095.);
......@@ -188,8 +213,8 @@ TNeProc::TNeProc(const char* name) : TGo4EventProcessor(name)
d1aF5 = MakeTH1('D', "ToF/aF5", "amplitude of plastic F5", 4000,0.,4000.,"amp F5");
d2ToFaF5 = MakeTH2('D', "ToF/ToFaF5", "ToF vs aF5", 400,50.,200.,400,0.,4000.,"ToF","aF5");
//-----MWPC-----
//-----MWPC-----
d2XY1 = MakeTH2('I', "MWPC/XY1", "WIRES 1 Y1 vs X1", 32,0.,32.,32,0.,32.,"X1","Y1");
d2XY2 = MakeTH2('I', "MWPC/XY2", "WIRES 2 Y2 vs X2", 32,0.,32.,32,0.,32.,"X2","Y2");
......@@ -223,17 +248,16 @@ Bool_t TNeProc::BuildEvent(TGo4EventElement* target)
{
// called by framework from TNeEvent to fill it
TGo4Analysis *go4 = TGo4Analysis::Instance();
// TGo4Analysis *go4 = TGo4Analysis::Instance();
TNeEvent* NeEvent = (TNeEvent*) target;
target->Clear();
TGo4MbsSubEvent* psubevt;
TGo4MbsEvent* fInput = (TGo4MbsEvent* ) GetInputEvent();
if(fInput == 0)
{
cout << "AnlProc: no input event !"<< endl;
return kFALSE;
if(fInput == 0) {
TGo4Log::Error( "TNeProc::BuildEvent: no input event !");
return false;
}
bool dooutput = false;
// double value1, value2;
......@@ -241,13 +265,13 @@ Bool_t TNeProc::BuildEvent(TGo4EventElement* target)
// int mLxa,mLya;
//
int num = 0, sz = 0;
int i, n, geo, typ, header,caen_header, module_id=0, crate=-1, cnt, chnl, evnt, ch;
int i, n, geo, typ, header,caen_header, module_id=0, crate=-1, cnt, chnl, evnt /*,gch*/;
// int mDSD_X, mDSD_Y, mCsI;
bool m_bool= false, c_bool = false;
uint16_t MSB, LSB;
uint32_t MSBLSB, adc;
uint32_t *idata;
double af3=0., af5=0., tf3=0., tf5=0., ToF=0.;
fInput->ResetIterator();
......@@ -256,9 +280,9 @@ Bool_t TNeProc::BuildEvent(TGo4EventElement* target)
num++;
sz += psubevt->GetIntLen();
idata = (uint32_t*) psubevt->GetDataField();
n = -1;
while(++n < psubevt->GetIntLen())
while(++n < psubevt->GetIntLen())
{
header = idata[n] >> 24;
caen_header = header & 0x7;
......@@ -281,106 +305,142 @@ Bool_t TNeProc::BuildEvent(TGo4EventElement* target)
}
if (m_bool) //in case of MESYTEC data
{
if (m_bool) {//in case of MESYTEC data
typ=idata[n] >> 30;
switch(typ)
{
case 1: //MESYTEC header
module_id = (idata[n] >> 16) & 0xff;
if (dooutput)
printf("Mesytec Module ID %d\n", module_id);
switch(typ) {
case 1: //MESYTEC header
module_id = (idata[n] >> 16) & 0xff;
if (dooutput)
printf("Mesytec Module ID %d\n", module_id);
break;
case 0: //MESYTEC data
if(idata[n] >> 24!=0x04) break;
switch (module_id) {
case 0: //mTDC: ToF
if ((idata[n] >> 16) & 0x20) break; //T bit analysis
chnl= (idata[n] >> 16) & 0x1f;
adc = idata[n] & 0xffff; //only 16 bits
if(chnl<4) NeEvent->tF3[chnl] = adc;
else if(chnl<8) NeEvent->tF5[chnl-4] = adc;
else if(chnl<12);
else if(chnl<16) NeEvent->tMWPC[chnl-12] = adc;
break;
case 1: //mQDC:
chnl= (idata[n] >> 16) & 0x1f;
adc = idata[n] & 0xfff; //only 12 bits
if(chnl<4) NeEvent->F3[chnl] = adc;
else if(chnl<8) NeEvent->F5[chnl-4] = adc;
break;
case 0: //MESYTEC data
if(idata[n] >> 24!=0x04) break;
switch (module_id)
{
case 0: //mTDC: ToF
if ((idata[n] >> 16) & 0x20) break; //T bit analysis
chnl= (idata[n] >> 16) & 0x1f;
adc = idata[n] & 0xffff; //only 16 bits
if(chnl<4) NeEvent->tF3[chnl] = adc;
else if(chnl<8) NeEvent->tF5[chnl-4] = adc;
else if(chnl<12);
else if(chnl<16) NeEvent->tMWPC[chnl-12] = adc;
break;
case 1: //mQDC:
chnl= (idata[n] >> 16) & 0x1f;
adc = idata[n] & 0xfff; //only 12 bits
if(chnl<4) NeEvent->F3[chnl] = adc;
else if(chnl<8) NeEvent->F5[chnl-4] = adc;
case 6: //scaler v560
for(i = 0; i < 16; ++i)
NeEvent->scaler[i]=idata[n++] & 0x07ffffff;
break;
break;
case 8: // mTDC: time Lx & Ly
chnl= (idata[n] >> 16)&0x3f;
adc = idata[n] & 0xfff; //only 12 bits
if(chnl<16) {
NeEvent->Lxt[chnl] = adc;
} else if(chnl<32) {
NeEvent->Lyt[chnl-16] = adc;
}
break;
case 6: //scaler v560
for(i = 0; i < 16; ++i)
NeEvent->scaler[i]=idata[n++] & 0x07ffffff;
break;
case 9: // mADC: amp Lx & Ly
chnl= (idata[n] >> 16)&0x1f;
adc = idata[n] & 0xfff; //only 12 bits
if(chnl<16) {
NeEvent->Lxa[chnl] = adc;
} else {
NeEvent->Lya[chnl-16] = adc;
}
break;
case 8: // mTDC: time Lx & Ly
chnl= (idata[n] >> 16)&0x3f;
adc = idata[n] & 0xfff; //only 12 bits
if(chnl<16) {
NeEvent->Lxt[chnl] = adc;
} else if(chnl<32) {
NeEvent->Lyt[chnl-16] = adc;
}
break;
case 10: // mTDC: time Rx & Ry
chnl= (idata[n] >> 16)&0x3f;
adc = idata[n] & 0xfff; //only 12 bits
if(chnl<16) {
NeEvent->Rxt[chnl] = adc;
} else if(chnl<32) {
NeEvent->Ryt[chnl-16] = adc;
}
break;
case 9: // mADC: amp Lx & Ly
chnl= (idata[n] >> 16)&0x1f;
adc = idata[n] & 0xfff; //only 12 bits
if(chnl<16) {
NeEvent->Lxa[chnl] = adc;
} else {
NeEvent->Lya[chnl-16] = adc;
}
break;
case 11: // mADC: amp Rx & Ry
chnl= (idata[n] >> 16)&0x1f;
adc = idata[n] & 0xfff; //only 12 bits
if(chnl<16) {
NeEvent->Rxa[chnl] = adc;
} else {
NeEvent->Rya[chnl-16] = adc;
}
break;
case 10: // mTDC: time Rx & Ry
chnl= (idata[n] >> 16)&0x3f;
adc = idata[n] & 0xfff; //only 12 bits
if(chnl<16) {
NeEvent->Rxt[chnl] = adc;
} else if(chnl<32) {
NeEvent->Ryt[chnl-16] = adc;
}
break;
case 12: // mTDC: time An S & R
chnl= (idata[n] >> 16)&0x3f;
adc = idata[n] & 0xfff; //only 12 bits
if(chnl<16) {
NeEvent->AnSt[chnl] = adc;
} else if(chnl<32) {
NeEvent->AnRt[chnl-16] = adc;
}
break;
case 11: // mADC: amp Rx & Ry
chnl= (idata[n] >> 16)&0x1f;
adc = idata[n] & 0xfff; //only 12 bits
if(chnl<16) {
NeEvent->Rxa[chnl] = adc;
} else {
NeEvent->Rya[chnl-16] = adc;
}
break;
case 13: // mADC: amp An S & R
chnl= (idata[n] >> 16)&0x1f;
adc = idata[n] & 0xfff; //only 12 bits
if(chnl<16) {
NeEvent->AnSa[chnl] = adc;
} else {
NeEvent->AnRa[chnl-16] = adc;
}
break;
case 12: // mTDC: time An S & R
chnl= (idata[n] >> 16)&0x3f;
adc = idata[n] & 0xfff; //only 12 bits
if(chnl<16) {
NeEvent->AnSt[chnl] = adc;
} else if(chnl<32) {
NeEvent->AnRt[chnl-16] = adc;
}
break;
case 14: // mTDC: time R20 & AnV
chnl= (idata[n] >> 16)&0x3f;
adc = idata[n] & 0xfff; //only 12 bits
if(chnl<16) {
NeEvent->AnVt[chnl] = adc;
} else if(chnl<32) {
NeEvent->R20t[chnl-16] = adc;
}
break;
case 13: // mADC: amp An S & R
chnl= (idata[n] >> 16)&0x1f;
adc = idata[n] & 0xfff; //only 12 bits
if(chnl<16) {
NeEvent->AnSa[chnl] = adc;
} else {
NeEvent->AnRa[chnl-16] = adc;
}
break;
case 15: // mADC: amp R20 & AnV
chnl= (idata[n] >> 16)&0x1f;
adc = idata[n] & 0xfff; //only 12 bits
if(chnl<16) {
NeEvent->AnVa[chnl] = adc;
} else {
NeEvent->R20a[chnl-16] = adc;
}
break;
}
break;
case 16: // mTDC: time Rcs & Lcs
chnl= (idata[n] >> 16)&0x3f;
adc = idata[n] & 0xfff; //only 12 bits
if(chnl<16) {
NeEvent->Lcst[chnl] = adc;
} else if(chnl<32) {
NeEvent->Rcst[chnl-16] = adc;
}
break;
case 17: // mADC: amp Rcs & Lcs
chnl= (idata[n] >> 16)&0x1f;
adc = idata[n] & 0xfff; //only 12 bits
if(chnl<16) {
NeEvent->Lcsa[chnl] = adc;
} else {
NeEvent->Rcsa[chnl-16] = adc;
}
break;
......@@ -389,26 +449,26 @@ Bool_t TNeProc::BuildEvent(TGo4EventElement* target)
break;
default:
printf("ERROR !!!!!! Unknown MESYTEC typ %d\n", typ);
printf("Data = %x\n", idata[n]);
break;
printf("ERROR !!!!!! Unknown MESYTEC typ %d\n", typ);
printf("Data = %x\n", idata[n]);
break;
}
}
else if (c_bool) //in case of CAEN data
{
typ = (idata[n] >> 24) & 0x7;
geo = idata[n] >> 27;
if (dooutput)
if (dooutput)
printf("CAEN geo %d\n", geo);
switch(typ)
switch(typ)
{
case 2: //CAEN header
crate = (idata[n] >> 16) & 0xff;
cnt = (idata[n] >> 8) & 0x1f;
if (geo==30)
NeEvent->mtime=idata[++n];//machine time
if (dooutput)
printf("Header: geo:%d crate:%d cnt = %d\n", geo, crate, cnt);
break;
......@@ -425,7 +485,7 @@ Bool_t TNeProc::BuildEvent(TGo4EventElement* target)
case 4: //CAEN footer
c_bool = false;
evnt = idata[n] & 0xffffff;
evnt = idata[n] & 0xffffff;
if (dooutput)
printf(" Event: geo:%d number:%d\n", geo, evnt);
break;
......@@ -439,7 +499,7 @@ Bool_t TNeProc::BuildEvent(TGo4EventElement* target)
default:
printf("ERROR !!!!!! Uncknown CAEN typ %d\n", typ);
printf("Data = %x\n", idata[n]);
break;
}
}
......@@ -451,19 +511,19 @@ Bool_t TNeProc::BuildEvent(TGo4EventElement* target)
switch(geo)
{
case 1:
case 1:
NeEvent->nx1 = 0;
adc = idata[++n];
LSB=adc;
//printf("First word from MWPC X1= %x\n", adc);
for(i = 0; i < 16; ++i)
if((adc & bit[i]) > 0) NeEvent->x1[NeEvent->nx1++] = i;
if((adc & bit[i]) > 0) NeEvent->x1[NeEvent->nx1++] = i;
adc = idata[++n];
MSB = adc;
MSBLSB = (MSB << 16) | LSB;
//printf("Second word from MWPC X1= %x\n", adc);
for(i = 0; i < 16; ++i)
if((adc & bit[i]) > 0) NeEvent->x1[NeEvent->nx1++] = i+16;
if((adc & bit[i]) > 0) NeEvent->x1[NeEvent->nx1++] = i+16;
adc = idata[++n];//pass throug footer
//printf("Third word from MWPC X1= %x\n", adc);
NeEvent->rx1=MSBLSB;
......@@ -475,7 +535,7 @@ Bool_t TNeProc::BuildEvent(TGo4EventElement* target)
LSB=adc;
//printf("First word from MWPC Y1 = %x\n", adc);
for(i = 0; i < 16; ++i)
if((adc & bit[i]) > 0) NeEvent->y1[NeEvent->ny1++] = i;
if((adc & bit[i]) > 0) NeEvent->y1[NeEvent->ny1++] = i;
adc = idata[++n];
MSB = adc;
MSBLSB= (MSB << 16) | LSB;
......@@ -485,7 +545,7 @@ Bool_t TNeProc::BuildEvent(TGo4EventElement* target)
adc = idata[++n];//pass through footer
//printf("Third word from MWPC Y1 = %x\n", adc);
NeEvent->ry1=MSBLSB;
break;
break;
case 3:
NeEvent->nx2 = 0;
adc = idata[++n];
......@@ -508,7 +568,7 @@ Bool_t TNeProc::BuildEvent(TGo4EventElement* target)
adc = idata[++n];
LSB=adc;
//printf("First word from MWPC Y2 = %x\n", adc);
for(i = 0; i < 16; ++i)
for(i = 0; i < 16; ++i)
if((adc & bit[i]) > 0) NeEvent->y2[NeEvent->ny2++] = i;
adc = idata[++n];
MSB = adc;
......@@ -521,9 +581,9 @@ Bool_t TNeProc::BuildEvent(TGo4EventElement* target)
NeEvent->ry2=MSBLSB;
break;
}
break; // end of CAMAC
case 200: //VME_1, see setup.usf
......@@ -541,12 +601,12 @@ Bool_t TNeProc::BuildEvent(TGo4EventElement* target)
if (m_bool) //in case of MESYTEC data
{
typ=idata[n] >> 30;
switch(typ)
switch(typ)
{
case 1: //MESYTEC header
module_id = (idata[n] >> 16) & 0xff;
if (dooutput)
if (dooutput)
printf("Mesytec Module ID %d\n", module_id);
break;
......@@ -583,26 +643,26 @@ Bool_t TNeProc::BuildEvent(TGo4EventElement* target)
break;
default:
printf("ERROR !!!!!! Unknown MESYTEC typ %d\n", typ);
printf("Data = %x\n", idata[n]);
break;
printf("ERROR !!!!!! Unknown MESYTEC typ %d\n", typ);
printf("Data = %x\n", idata[n]);
break;
}
}
else if (c_bool) //in case of CAEN data
{
typ = (idata[n] >> 24) & 0x7;
geo = idata[n] >> 27;
if (dooutput)
if (dooutput)
printf("CAEN geo %d\n", geo);
switch(typ)
switch(typ)
{
case 2: //CAEN header
crate = (idata[n] >> 16) & 0xff;
cnt = (idata[n] >> 8) & 0x1f;
if (geo==30)
NeEvent->mtime=idata[++n];//machine time
if (dooutput)
printf("Header: geo:%d crate:%d cnt = %d\n", geo, crate, cnt);
break;
......@@ -614,7 +674,7 @@ Bool_t TNeProc::BuildEvent(TGo4EventElement* target)
switch(geo)
{
case 6: //scaler v560
for(i = 0; i < 16; ++i)
for(i = 0; i < 16; ++i)
NeEvent->scaler[i]=idata[n++] & 0x07ffffff;
break;
}
......@@ -623,7 +683,7 @@ Bool_t TNeProc::BuildEvent(TGo4EventElement* target)
case 4: //CAEN footer
c_bool = false;
evnt = idata[n] & 0xffffff;
evnt = idata[n] & 0xffffff;
if (dooutput)
printf(" Event: geo:%d number:%d\n", geo, evnt);
break;
......@@ -637,7 +697,7 @@ Bool_t TNeProc::BuildEvent(TGo4EventElement* target)
default:
printf("ERROR !!!!!! Uncknown CAEN typ %d\n", typ);
printf("Data = %x\n", idata[n]);
break;
}
}
......@@ -649,7 +709,7 @@ Bool_t TNeProc::BuildEvent(TGo4EventElement* target)
} //end of NextSubEvent
NeEvent->nevent = fInput->GetCount();
NeEvent->trigger = fInput->GetTrigger();
NeEvent->trigger = fInput->GetTrigger();
NeEvent->subevents = num;
NeEvent->evsize = sz;
......@@ -657,10 +717,10 @@ Bool_t TNeProc::BuildEvent(TGo4EventElement* target)
fSubEvents->Fill(num);
fEventsSizes->Fill(sz);
//
//
for (n=0; n<4; ++n)
// if(NeEvent->trigger == 2)
// if(NeEvent->trigger == 2)
{
if(NeEvent->F3[n] > 0 ) d1F3[n]->Fill(NeEvent->F3[n]);
if(NeEvent->F5[n] > 0) d1F5[n]->Fill(NeEvent->F5[n]);
......@@ -673,12 +733,12 @@ Bool_t TNeProc::BuildEvent(TGo4EventElement* target)
//
if(NeEvent->F3[0]>0&&NeEvent->F3[1]>0&&NeEvent->F3[2]>0&&NeEvent->F3[3]>0)
af3 = (NeEvent->F3[0]+NeEvent->F3[1]+NeEvent->F3[2]+NeEvent->F3[3]+4.*gRandom->Uniform())/4.;
if(NeEvent->F5[0]>0&&NeEvent->F5[1]>0&&NeEvent->F5[2]>0&&NeEvent->F5[3]>0)
if(NeEvent->F5[0]>0&&NeEvent->F5[1]>0&&NeEvent->F5[2]>0&&NeEvent->F5[3]>0)
af5 = (NeEvent->F5[0]+NeEvent->F5[1]+NeEvent->F5[2]+NeEvent->F5[3]+4.*gRandom->Uniform())/4.;
if(NeEvent->tF3[0]>0&&NeEvent->tF3[1]>0&&NeEvent->tF3[2]>0&&NeEvent->tF3[3]>0)
tf3 = (NeEvent->tF3[0]+NeEvent->tF3[1]+NeEvent->tF3[2]+NeEvent->tF3[3]+4.*gRandom->Uniform())/4.;
if(NeEvent->tF5[0]>0&&NeEvent->tF5[1]>0&&NeEvent->tF5[2]>0&&NeEvent->tF5[3]>0)
if(NeEvent->tF5[0]>0&&NeEvent->tF5[1]>0&&NeEvent->tF5[2]>0&&NeEvent->tF5[3]>0)
tf5 = (NeEvent->tF5[0]+NeEvent->tF5[1]+NeEvent->tF5[2]+NeEvent->tF5[3]+4.*gRandom->Uniform())/4.;
//
......@@ -690,7 +750,7 @@ ToF = (tf5 - tf3)*0.015625 + 68.475;
if(af3*af5*tf3*tf5!=0)
{
// if(NeEvent->trigger == 1)
// if(NeEvent->trigger == 1)
{
d1ToF->Fill(ToF);
d1aF3->Fill(af3);
......@@ -701,19 +761,46 @@ ToF = (tf5 - tf3)*0.015625 + 68.475;
}
}
for (n=0; n<16; ++n) {
if(NeEvent->Lxt[n]>0) d1Lxa[n]->Fill(NeEvent->Lxa[n]);
d1Lxt[n]->Fill(NeEvent->Lxt[n]);
if(NeEvent->Lyt[n]>0) d1Lya[n]->Fill(NeEvent->Lya[n]);
d1Lyt[n]->Fill(NeEvent->Lyt[n]);
if(NeEvent->Rxt[n]>0) d1Rxa[n]->Fill(NeEvent->Rxa[n]);
d1Rxt[n]->Fill(NeEvent->Rxt[n]);
if(NeEvent->Ryt[n]>0) d1Rya[n]->Fill(NeEvent->Rya[n]);
d1Ryt[n]->Fill(NeEvent->Ryt[n]);
if(NeEvent->AnSt[n]>0) d1AnSa[n]->Fill(NeEvent->AnSa[n]);
d1AnSt[n]->Fill(NeEvent->AnSt[n]);
if(NeEvent->AnRt[n]>0) d1AnRa[n]->Fill(NeEvent->AnRa[n]);
d1AnRt[n]->Fill(NeEvent->AnRt[n]);
for (int n=0; n<16; ++n) {
if(NeEvent->Lxt[n]>0){
d1Lxa[n]->Fill(NeEvent->Lxa[n]);
d1Lxt[n]->Fill(NeEvent->Lxt[n]);
}
if(NeEvent->Lyt[n]>0){
d1Lya[n]->Fill(NeEvent->Lya[n]);
d1Lyt[n]->Fill(NeEvent->Lyt[n]);
}
if(NeEvent->Rxt[n]>0){
d1Rxa[n]->Fill(NeEvent->Rxa[n]);
d1Rxt[n]->Fill(NeEvent->Rxt[n]);
}
if(NeEvent->Ryt[n]>0){
d1Rya[n]->Fill(NeEvent->Rya[n]);
d1Ryt[n]->Fill(NeEvent->Ryt[n]);
}
if(NeEvent->R20t[n]>0){
d1R20a[n]->Fill(NeEvent->R20a[n]);
d1R20t[n]->Fill(NeEvent->R20t[n]);
}
if(NeEvent->AnSt[n]>0){
d1AnSa[n]->Fill(NeEvent->AnSa[n]);
d1AnSt[n]->Fill(NeEvent->AnSt[n]);
}
if(NeEvent->AnRt[n]>0){
d1AnRa[n]->Fill(NeEvent->AnRa[n]);
d1AnRt[n]->Fill(NeEvent->AnRt[n]);
}
if(NeEvent->Rcst[n]>0){
d1Rcsa[n]->Fill(NeEvent->Rcsa[n]);
d1Rcst[n]->Fill(NeEvent->Rcst[n]);
}
if(NeEvent->Lcst[n]>0){
d1Lcsa[n]->Fill(NeEvent->Lcsa[n]);
d1Lcst[n]->Fill(NeEvent->Lcst[n]);
}
}
//-----p1 secrors amp.-----
/*
......@@ -734,7 +821,7 @@ ToF = (tf5 - tf3)*0.015625 + 68.475;
for (n=0; n<16; ++n)
{
value1 = (double)NeEvent->p1s[n] + gRandom->Uniform();
value1 = (double)NeEvent->p1s[n] + gRandom->Uniform();
value2 = ((TNeAnalysis*)go4)->p_p1s->Energy(value1, n);
d1_Lxa_c[n]->Fill(value2);
mp1s++;
......
......@@ -8,17 +8,17 @@
//-----class TNeParam-----;
extern int otl;
class TNeProc : public TGo4EventProcessor
class TNeProc : public TGo4EventProcessor
{
public:
TNeProc() ;
TNeProc(const char* name);
virtual ~TNeProc() ;
Bool_t BuildEvent(TGo4EventElement* target); // event processing function
//! event processing function
Bool_t BuildEvent(TGo4EventElement* target);
double GetClasters(unsigned short n, unsigned short *x);
static long bit[32];
private:
TH1 *fTrigger;
TH1 *fSubEvents;
......@@ -47,6 +47,20 @@ private:
TH1 *d1AnVa[16];
TH1 *d1AnVt[16];
TH1 *d1AnVc[16];
TH1 *d1R20a[16];
TH1 *d1R20t[16];
TH1 *d1R20c[16];
TH1 *d1Rcsa[16];
TH1 *d1Rcst[16];
TH1 *d1Rcsc[16];
TH1 *d1Lcsa[16];
TH1 *d1Lcst[16];
TH1 *d1Lcsc[16];
//-----clb-----
TH1 *d1sq1_x_c[16];
//-----ToF+MWPC-----
......@@ -64,7 +78,7 @@ private:
TH2 *d2ToFaF5;
//-----CALIBRATED-----
//-----neutrons-----
//-----neutrons-----
//-----WIRES-----
TH1 *d1X1;
TH1 *d1Y1;
......
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