Commit ef22b299 authored by Pavel Sharov's avatar Pavel Sharov

* add writing of multiplicity and etc. for left 1mm detector to TNeEvent

parent 283f92c7
......@@ -22,6 +22,7 @@
#pragma link C++ class TNeProc+;
#pragma link C++ class TNeMParms+;
#pragma link C++ class TNeSel+;
#pragma link C++ class TDSSD16+;
#endif
......
......@@ -2,6 +2,15 @@
## 24e01
### Naming conventions
- prefix T[number]x is for telescope
- By default channel 1--16 for X-strips 16--32 for Y.
- prefix L is for left shoulder R for right
- By default channel 1--16 for X-strips 16--32 for Y.
### TDSSD16
`TDSSD16` is container for double-side 1mm telescope.
Members:
- multx,multy --- multiplicity on each side
- sx,sy --- strip number
- depx,depy --- Edep in MeV
- posx,posy --- local position in mm
now only left 1mm detector added to `TNeEvent` (it named as `L1`).
......@@ -34,6 +34,7 @@ void TNeEvent::Clear(Option_t *t)
//== memset(fRawData,0, sizeof(fRawData));
//==================================================================
// Si
L1.Clear();
memset(Lxa, 0, sizeof(Lxa));
memset(Lxt, 0, sizeof(Lxt));
memset(Lya, 0, sizeof(Lya));
......
......@@ -8,6 +8,7 @@
#define TNeEVENT_H
#include "TGo4EventElement.h"
#include "TDSSD16.h"
class TNeEvent : public TGo4EventElement
{
......@@ -20,6 +21,7 @@ public:
void Clear(Option_t *t="");
//-----Si-----
TDSSD16 L1;
unsigned short Lxa[16];
unsigned short Lxt[16];
unsigned short Lxc[16];
......
/* -*- mode:c++ c-file-style:"linux" -*- */
//===================================================================
//== EXPERIMENT A-2
//== VERSION: 30.10.2018
......@@ -49,20 +50,16 @@ TNeProc::TNeProc() : TGo4EventProcessor()
fTrigger = NULL;
fSubEvents = NULL;
fEventsSizes = NULL;
for(i = 0; i < 4; ++i)
{
for(i = 0; i < 4; ++i) {
d1F3[i] = NULL;
d1tF3[i] = NULL;
d1F5[i] = NULL;
d1tF5[i] = NULL;
d1tMWPC[i] = NULL;
}
for(i = 0; i < 16; ++i)
{
for(i = 0; i < 16; ++i) {
//-----Si-----
d1Lxa[i] = NULL;
d1Lxt[i] = NULL;
......@@ -291,7 +288,7 @@ Bool_t TNeProc::BuildEvent(TGo4EventElement* target)
TGo4Analysis *go4 = TGo4Analysis::Instance();
TNeEvent* NeEvent = (TNeEvent*) target;
target->Clear();
NeEvent->Clear();
TGo4MbsSubEvent* psubevt;
TGo4MbsEvent* fInput = (TGo4MbsEvent* ) GetInputEvent();
......@@ -316,36 +313,28 @@ Bool_t TNeProc::BuildEvent(TGo4EventElement* target)
double af3=0., af5=0., tf3=0., tf5=0., ToF=0.;
fInput->ResetIterator();
while((psubevt = fInput->NextSubEvent()) != 0)
{
while((psubevt = fInput->NextSubEvent()) != 0) {
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;
if (dooutput)
printf("Raw data = %x\n", idata[n]);
switch (psubevt->GetProcid())
{
switch (psubevt->GetProcid()) {
case 100: //VME_0, see setup.usf
if (header==0x40)
m_bool=true; //MESYTEC header flag
else if (caen_header == 2)
c_bool=true; //CAEN header flag
else if ((idata[n]==0xaffeaffe) || (idata[n]== 0x06000000) || (idata[n]== 0x05000000))
{
else if ((idata[n]==0xaffeaffe) || (idata[n]== 0x06000000) || (idata[n]== 0x05000000)) {
c_bool=false;
m_bool=false;
}
if (m_bool) {//in case of MESYTEC data
typ=idata[n] >> 30;
......@@ -358,16 +347,17 @@ Bool_t TNeProc::BuildEvent(TGo4EventElement* target)
case 0: //MESYTEC data
if(idata[n] >> 24!=0x04) break;
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;
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;
......@@ -387,7 +377,7 @@ Bool_t TNeProc::BuildEvent(TGo4EventElement* target)
adc = idata[n] & 0xfff; //only 12 bits
if(chnl<16) {
NeEvent->Lxt[chnl] = adc;
} else if(chnl<32) {
} else if (chnl<32) {
NeEvent->Lyt[chnl-16] = adc;
}
break;
......@@ -507,15 +497,13 @@ Bool_t TNeProc::BuildEvent(TGo4EventElement* target)
break;
}
}
else if (c_bool) //in case of CAEN data
{
else if (c_bool) { //in case of CAEN data
typ = (idata[n] >> 24) & 0x7;
geo = idata[n] >> 27;
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;
......@@ -530,9 +518,9 @@ Bool_t TNeProc::BuildEvent(TGo4EventElement* target)
adc = idata[n] & 0xfff;
chnl = (idata[n] >> 16) & 0x1f;
//printf("DATA: geo:%d Channel = %d\n", geo, chnl);
switch(geo)
/*switch(geo)
{
}
}*/
// printf(" Data: geo:%d chnl:%d adc:%d\n", geo, chnl, adc);
break;
......@@ -561,9 +549,7 @@ Bool_t TNeProc::BuildEvent(TGo4EventElement* target)
case 101: // CAMAC through VME_0, see setup.usf
geo = idata[n] >> 27;
switch(geo)
{
switch(geo) {
case 1:
NeEvent->nx1 = 0;
adc = idata[++n];
......@@ -639,13 +625,11 @@ Bool_t TNeProc::BuildEvent(TGo4EventElement* target)
case 200: //VME_1, see setup.usf
if (header==0x40)
m_bool=true; //MESYTEC header flag
else if (caen_header == 2)
c_bool=true; //CAEN header flag
else if ((idata[n]==0xaffeaffe) || (idata[n]== 0x06000000) || (idata[n]== 0x05000000))
{
else if ((idata[n]==0xaffeaffe) || (idata[n]== 0x06000000) || (idata[n]== 0x05000000)) {
c_bool=false;
m_bool=false;
}
......@@ -655,8 +639,7 @@ Bool_t TNeProc::BuildEvent(TGo4EventElement* target)
{
typ=idata[n] >> 30;
switch(typ)
{
switch(typ) {
case 1: //MESYTEC header
module_id = (idata[n] >> 16) & 0xff;
if (dooutput)
......@@ -666,8 +649,7 @@ Bool_t TNeProc::BuildEvent(TGo4EventElement* target)
case 0: //MESYTEC data
if(idata[n] >> 24!=0x04) break;
switch (module_id)
{
switch (module_id) {
case 3: // mTDC: time sect & rings p1
chnl= (idata[n] >> 16)&0x3f;
adc = idata[n] & 0xfff; //only 12 bits
......@@ -701,15 +683,14 @@ Bool_t TNeProc::BuildEvent(TGo4EventElement* target)
break;
}
}
else if (c_bool) //in case of CAEN data
{
else if (c_bool) {//in case of CAEN data
typ = (idata[n] >> 24) & 0x7;
geo = idata[n] >> 27;
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;
......@@ -724,8 +705,7 @@ Bool_t TNeProc::BuildEvent(TGo4EventElement* target)
adc = idata[n] & 0xfff;
chnl = (idata[n] >> 16) & 0x1f;
//printf("DATA: geo:%d Channel = %d\n", geo, chnl);
switch(geo)
{
switch(geo) {
case 6: //scaler v560
for(i = 0; i < 16; ++i)
NeEvent->scaler[i]=idata[n++] & 0x07ffffff;
......@@ -772,9 +752,9 @@ Bool_t TNeProc::BuildEvent(TGo4EventElement* target)
//
for (n=0; n<4; ++n)
for (n=0; n<4; ++n){
// 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]);
......@@ -799,20 +779,17 @@ Bool_t TNeProc::BuildEvent(TGo4EventElement* target)
// ToF = (tf5 - tf3)*0.0625;
// ToF = (tf5 - tf3)*0.0625 + 68.55;
// ToF = (tf5 - tf3)*0.0625 + 68.475;
ToF = (tf5 - tf3)*0.015625 + 68.475;
ToF = (tf5 - tf3)*0.015625 + 68.475;
if(af3*af5*tf3*tf5!=0)
{
if(af3*af5*tf3*tf5!=0) {
// if(NeEvent->trigger == 1)
{
d1ToF->Fill(ToF);
d1aF3->Fill(af3);
d2ToFaF3->Fill(ToF,af3);
d1aF5->Fill(af5);
d2ToFaF5->Fill(ToF,af5);
}
}
for (int n=0; n<16; ++n) {
// if(NeEvent->Lxt[n]>0)
......@@ -894,14 +871,18 @@ ToF = (tf5 - tf3)*0.015625 + 68.475;
*/
//______ calibrated spectra __________________________
for (n=0; n<16; ++n)
{
for (int n=0; n<16; ++n) {
if(NeEvent->Lxt[n]>0){
value1 = (double)NeEvent->Lxa[n] + gRandom->Uniform();
value2 = ((TNeAnalysis*)go4)->p_Lxa->Energy(value1, n);
d1Lxc[n]->Fill(value2);
mLxa++;
eLxa = value2;
// fill TNeEvent
NeEvent->L1.sx[NeEvent->L1.multx]=n;
NeEvent->L1.posx[NeEvent->L1.multx]=NeEvent->L1.str2pos(n);
NeEvent->L1.depx[NeEvent->L1.multx]=value2;
NeEvent->L1.multx++;
}
if(NeEvent->Lyt[n]>0){
......@@ -910,6 +891,11 @@ ToF = (tf5 - tf3)*0.015625 + 68.475;
d1Lyc[n]->Fill(value2);
mLya++;
eLya = value2;
NeEvent->L1.sy[NeEvent->L1.multy]=n;
NeEvent->L1.posy[NeEvent->L1.multy]=NeEvent->L1.str2pos(n);
NeEvent->L1.depy[NeEvent->L1.multy]=value2;
NeEvent->L1.multy++;
}
if(NeEvent->Rxt[n]>0){
......
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