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: //== TNeEvent.cxx:
//== Version: //== Version:
...@@ -6,6 +8,7 @@ using namespace std; ...@@ -6,6 +8,7 @@ using namespace std;
#include "TNeEvent.h" #include "TNeEvent.h"
#include "Riostream.h" #include "Riostream.h"
#include <algorithm>
TNeEvent::TNeEvent() TNeEvent::TNeEvent()
:TGo4EventElement() :TGo4EventElement()
...@@ -41,14 +44,21 @@ void TNeEvent::Clear(Option_t *t) ...@@ -41,14 +44,21 @@ void TNeEvent::Clear(Option_t *t)
memset(Ryt, 0, sizeof(Ryt)); memset(Ryt, 0, sizeof(Ryt));
memset(RVa, 0, sizeof(RVa)); memset(RVa, 0, sizeof(RVa));
memset(RVt, 0, sizeof(RVt)); memset(RVt, 0, sizeof(RVt));
memset(R60a, 0, sizeof(R60a)); memset(R20a, 0, sizeof(R20a));
memset(R60t, 0, sizeof(R60t)); memset(R20t, 0, sizeof(R20t));
memset(AnSa, 0, sizeof(AnSa)); memset(AnSa, 0, sizeof(AnSa));
memset(AnSt, 0, sizeof(AnSt)); memset(AnSt, 0, sizeof(AnSt));
memset(AnRa, 0, sizeof(AnRa)); memset(AnRa, 0, sizeof(AnRa));
memset(AnRt, 0, sizeof(AnRt)); memset(AnRt, 0, sizeof(AnRt));
memset(AnVa, 0, sizeof(AnVa)); memset(AnVa, 0, sizeof(AnVa));
memset(AnVt, 0, sizeof(AnVt)); 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 // ToF
memset(F3, 0, sizeof(F3)); memset(F3, 0, sizeof(F3));
...@@ -60,7 +70,6 @@ void TNeEvent::Clear(Option_t *t) ...@@ -60,7 +70,6 @@ void TNeEvent::Clear(Option_t *t)
memset(tMWPC, 0, sizeof(tMWPC)); memset(tMWPC, 0, sizeof(tMWPC));
nevent = 0; nevent = 0;
trigger = 0; trigger = 0;
subevents = 0; subevents = 0;
......
/* -*- mode:c++ c-file-style:"linux" -*- */
//=================================================================== //===================================================================
//== TNeEvent.h: //== TNeEvent.h:
//== Version: //== Version:
...@@ -29,14 +30,18 @@ public: ...@@ -29,14 +30,18 @@ public:
unsigned short Ryt[16]; unsigned short Ryt[16];
unsigned short RVa[16]; unsigned short RVa[16];
unsigned short RVt[16]; unsigned short RVt[16];
unsigned short R60a[16]; unsigned short R20a[16];
unsigned short R60t[16]; unsigned short R20t[16];
unsigned short AnSa[16]; unsigned short AnSa[16];
unsigned short AnSt[16]; unsigned short AnSt[16];
unsigned short AnRa[16]; unsigned short AnRa[16];
unsigned short AnRt[16]; unsigned short AnRt[16];
unsigned short AnVa[16]; unsigned short AnVa[16];
unsigned short AnVt[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 F3[4];
unsigned short tF3[4]; unsigned short tF3[4];
......
...@@ -159,6 +159,31 @@ TNeProc::TNeProc(const char* name) : TGo4EventProcessor(name) ...@@ -159,6 +159,31 @@ TNeProc::TNeProc(const char* name) : TGo4EventProcessor(name)
d1AnRc[i] = MakeTH1('D', Form("AnRc/AnRcs_%2.2d",i) d1AnRc[i] = MakeTH1('D', Form("AnRc/AnRcs_%2.2d",i)
, Form("Ring energy MeV %2.2d",i), 4000, -2., 98.); , 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[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.); d1F3[1] = MakeTH1('I',"F3/QDC/F3_QDC_R","F3 QDC right", 4096, 0., 4095.);
...@@ -223,17 +248,16 @@ Bool_t TNeProc::BuildEvent(TGo4EventElement* target) ...@@ -223,17 +248,16 @@ Bool_t TNeProc::BuildEvent(TGo4EventElement* target)
{ {
// called by framework from TNeEvent to fill it // called by framework from TNeEvent to fill it
TGo4Analysis *go4 = TGo4Analysis::Instance(); // TGo4Analysis *go4 = TGo4Analysis::Instance();
TNeEvent* NeEvent = (TNeEvent*) target; TNeEvent* NeEvent = (TNeEvent*) target;
target->Clear(); target->Clear();
TGo4MbsSubEvent* psubevt; TGo4MbsSubEvent* psubevt;
TGo4MbsEvent* fInput = (TGo4MbsEvent* ) GetInputEvent(); TGo4MbsEvent* fInput = (TGo4MbsEvent* ) GetInputEvent();
if(fInput == 0) if(fInput == 0) {
{ TGo4Log::Error( "TNeProc::BuildEvent: no input event !");
cout << "AnlProc: no input event !"<< endl; return false;
return kFALSE;
} }
bool dooutput = false; bool dooutput = false;
// double value1, value2; // double value1, value2;
...@@ -241,7 +265,7 @@ Bool_t TNeProc::BuildEvent(TGo4EventElement* target) ...@@ -241,7 +265,7 @@ Bool_t TNeProc::BuildEvent(TGo4EventElement* target)
// int mLxa,mLya; // int mLxa,mLya;
// //
int num = 0, sz = 0; 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; // int mDSD_X, mDSD_Y, mCsI;
bool m_bool= false, c_bool = false; bool m_bool= false, c_bool = false;
uint16_t MSB, LSB; uint16_t MSB, LSB;
...@@ -281,12 +305,10 @@ Bool_t TNeProc::BuildEvent(TGo4EventElement* target) ...@@ -281,12 +305,10 @@ 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; typ=idata[n] >> 30;
switch(typ) switch(typ) {
{
case 1: //MESYTEC header case 1: //MESYTEC header
module_id = (idata[n] >> 16) & 0xff; module_id = (idata[n] >> 16) & 0xff;
if (dooutput) if (dooutput)
...@@ -296,8 +318,7 @@ Bool_t TNeProc::BuildEvent(TGo4EventElement* target) ...@@ -296,8 +318,7 @@ Bool_t TNeProc::BuildEvent(TGo4EventElement* target)
case 0: //MESYTEC data case 0: //MESYTEC data
if(idata[n] >> 24!=0x04) break; if(idata[n] >> 24!=0x04) break;
switch (module_id) switch (module_id) {
{
case 0: //mTDC: ToF case 0: //mTDC: ToF
if ((idata[n] >> 16) & 0x20) break; //T bit analysis if ((idata[n] >> 16) & 0x20) break; //T bit analysis
chnl= (idata[n] >> 16) & 0x1f; chnl= (idata[n] >> 16) & 0x1f;
...@@ -380,7 +401,46 @@ Bool_t TNeProc::BuildEvent(TGo4EventElement* target) ...@@ -380,7 +401,46 @@ Bool_t TNeProc::BuildEvent(TGo4EventElement* target)
} }
break; 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 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; break;
...@@ -701,19 +761,46 @@ ToF = (tf5 - tf3)*0.015625 + 68.475; ...@@ -701,19 +761,46 @@ ToF = (tf5 - tf3)*0.015625 + 68.475;
} }
} }
for (n=0; n<16; ++n) { for (int n=0; n<16; ++n) {
if(NeEvent->Lxt[n]>0) d1Lxa[n]->Fill(NeEvent->Lxa[n]); if(NeEvent->Lxt[n]>0){
d1Lxa[n]->Fill(NeEvent->Lxa[n]);
d1Lxt[n]->Fill(NeEvent->Lxt[n]); d1Lxt[n]->Fill(NeEvent->Lxt[n]);
if(NeEvent->Lyt[n]>0) d1Lya[n]->Fill(NeEvent->Lya[n]); }
if(NeEvent->Lyt[n]>0){
d1Lya[n]->Fill(NeEvent->Lya[n]);
d1Lyt[n]->Fill(NeEvent->Lyt[n]); d1Lyt[n]->Fill(NeEvent->Lyt[n]);
if(NeEvent->Rxt[n]>0) d1Rxa[n]->Fill(NeEvent->Rxa[n]); }
if(NeEvent->Rxt[n]>0){
d1Rxa[n]->Fill(NeEvent->Rxa[n]);
d1Rxt[n]->Fill(NeEvent->Rxt[n]); d1Rxt[n]->Fill(NeEvent->Rxt[n]);
if(NeEvent->Ryt[n]>0) d1Rya[n]->Fill(NeEvent->Rya[n]); }
if(NeEvent->Ryt[n]>0){
d1Rya[n]->Fill(NeEvent->Rya[n]);
d1Ryt[n]->Fill(NeEvent->Ryt[n]); d1Ryt[n]->Fill(NeEvent->Ryt[n]);
if(NeEvent->AnSt[n]>0) d1AnSa[n]->Fill(NeEvent->AnSa[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]); d1AnSt[n]->Fill(NeEvent->AnSt[n]);
if(NeEvent->AnRt[n]>0) d1AnRa[n]->Fill(NeEvent->AnRa[n]); }
if(NeEvent->AnRt[n]>0){
d1AnRa[n]->Fill(NeEvent->AnRa[n]);
d1AnRt[n]->Fill(NeEvent->AnRt[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.----- //-----p1 secrors amp.-----
/* /*
......
...@@ -14,8 +14,8 @@ public: ...@@ -14,8 +14,8 @@ public:
TNeProc() ; TNeProc() ;
TNeProc(const char* name); TNeProc(const char* name);
virtual ~TNeProc() ; virtual ~TNeProc() ;
//! event processing function
Bool_t BuildEvent(TGo4EventElement* target); // event processing function Bool_t BuildEvent(TGo4EventElement* target);
double GetClasters(unsigned short n, unsigned short *x); double GetClasters(unsigned short n, unsigned short *x);
static long bit[32]; static long bit[32];
...@@ -47,6 +47,20 @@ private: ...@@ -47,6 +47,20 @@ private:
TH1 *d1AnVa[16]; TH1 *d1AnVa[16];
TH1 *d1AnVt[16]; TH1 *d1AnVt[16];
TH1 *d1AnVc[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----- //-----clb-----
TH1 *d1sq1_x_c[16]; TH1 *d1sq1_x_c[16];
//-----ToF+MWPC----- //-----ToF+MWPC-----
......
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