--- eventviewer/flight/src/FEVdetector.cpp 2007/02/02 14:35:57 1.8 +++ eventviewer/flight/src/FEVdetector.cpp 2007/02/28 09:29:55 1.12 @@ -46,6 +46,8 @@ #include #include #include +#include +#include // #include #include @@ -86,7 +88,10 @@ var.SHOWDEC = 0; var.TOF = 0; var.AC = 0; + var.RUN = 1; var.TRK = 0; + var.ORB = 0; + var.TRG = 0; var.CALO = 0; var.S4 = 0; var.ND = 0; @@ -122,20 +127,33 @@ }; } +void FEVdetector::SetDDEC(TString de){ + ddec=de; +}; + void FEVdetector::GetWindow(){ otr->GetEntry(maxevent); + // if ( level.file < 2 ){ ph = eh->GetPscuHeader(); lastevno = (int)ph->Counter; } else { - lastevno = L2->GetOrbitalInfo()->pkt_num; // to be changed as soon as we will have pkt_counter in the level2 file! + if ( var.ORB ){ + lastevno = L2->GetOrbitalInfo()->pkt_num; + } else { + lastevno = 0; + }; }; otr->GetEntry(minevent); if ( level.file < 2 ){ ph = eh->GetPscuHeader(); firstevno = (int)ph->Counter; } else { - firstevno = L2->GetOrbitalInfo()->pkt_num; // to be changed as soon as we will have pkt_counter in the level2 file! + if ( var.ORB ){ + firstevno = L2->GetOrbitalInfo()->pkt_num; + } else { + firstevno = 0; + }; }; } @@ -161,6 +179,12 @@ void FEVdetector::GetEntry(Int_t i){ thisentry = i; otr->GetEntry(i); +// if ( level.file == 2 ){ +// ShowInfo("TrkLevel2"); +// ShowInfo("ToFLevel2"); +// ShowInfo("CaloLevel2"); +// }; + // PrintData(otr,-1LL,44); } void FEVdetector::SetEntry(Int_t i){ @@ -281,6 +305,503 @@ }; } +void FEVdetector::PrintLeaves(TTree *otr, Int_t i, TBranchElement *tb, Int_t lenmax){ + // -- Prints values of leaves. + + // tb->ValidateAddress(); + printf("son qua \n"); + + // if (otr->GetMakeClass()) { + if (!tb->GetAddress()) { + printf("esco \n"); + return; + } + if (tb->GetType() == 3 || tb->GetType() == 4) { + // TClonesArray or STL container top-level branch. + printf("3 o 4 %-15s = %d\n", tb->GetName(), tb->GetNdata()); + return; + } else if (tb->GetType() == 31 || tb->GetType() == 41) { + printf(" 31 o 41 \n"); + // TClonesArray or STL container sub-branch. + Int_t n = TMath::Min(10, tb->GetNdata()); + Int_t atype = tb->GetStreamerType() + 20; + if (tb->GetStreamerType() == 1) { + // TVirtualStreamerInfo::kOffsetL + TVirtualStreamerInfo::kChar is + // printed as a string and could print weird characters. + // So we print an unsigned char instead (not perfect, but better). + atype = 20 + 11 ; + } + if (atype > 54) { + // FIXME: More logic required here (like in ReadLeaves) + printf(">54 %-15s = %d\n", tb->GetName(), tb->GetNdata()); + return; + } + if (tb->GetStreamerType() > 20) { + atype -= 20; +// TObjArray *prova= otr->GetListOfLeaves(); +// // TObjArray* leaf2 = (TObjArray*) prova->UncheckedAt(i); +// //TLeaf* leaf = (TLeaf*)(otr->GetLeaf(tb->GetName())); +// // TLeafElement* leaf = (TLeafElement*)((TLeaf*)(otr->GetListOfLeaves()->UncheckedAt(i))->GetBranch()->UncheckedAt(0)); +// TLeafElement* leaf = (TLeafElement*)(prova->UncheckedAt(0)); +// n = n * leaf->GetLenStatic(); + } + if (tb->GetInfo()) { + // n = 16; + // tb->GetInfo()->PrintValue(tb->GetName(), tb->GetAddress(), atype, n, lenmax); + //tb->GetObject()->GetInfo()->PrintValue(tb->GetName(), tb->GetObject(), atype, n, lenmax); + } + return; + } else if (tb->GetType() <= 2) { + printf(" <=2 \n"); + // Branch in split mode. + // FIXME: This should probably be < 60 instead. + if ((tb->GetStreamerType() > 40) && (tb->GetStreamerType() < 55)) { + Int_t atype = tb->GetStreamerType() - 20; + TBranchElement* counterElement = (TBranchElement*) tb->GetBranchCount(); + Int_t n = (Int_t) counterElement->GetValue(0, 0); + if (tb->GetInfo()) { + tb->GetInfo()->PrintValue(tb->GetName(), tb->GetAddress(), atype, n, lenmax); + } + } else { + // if (tb->GetInfo()) { + // tb->GetInfo()->PrintValue(tb->GetName(), tb->GetObject(), tb->GetID(), -1, lenmax); + // } + // } + return; + } + } else if (tb->GetType() == 3) { + printf("3 %-15s = %d\n", tb->GetName(), tb->GetNdata()); + } else if (tb->GetType() == 31) { + printf("31 %-15s = %d\n", tb->GetName(), tb->GetNdata()); + // TClonesArray* clones = (TClonesArray*) tb->GetObject(); + // if (tb->GetInfo()) { + // tb->GetInfo()->PrintValueClones(tb->GetName(), clones, tb->GetID(), tb->GetOffset(), lenmax); + // } + } else if (tb->GetType() == 41) { + printf("41 %-15s = %d\n", tb->GetName(), tb->GetNdata()); + // TVirtualCollectionProxy::TPushPop helper(((TBranchElement*) this)->GetCollectionProxy(), fObject); + // if (GetInfo()) { + // GetInfo()->PrintValueSTL(GetName(), ((TBranchElement*) this)->GetCollectionProxy(), fID, fOffset, lenmax); + // } + } else { + printf("else %-15s = %d\n", tb->GetName(), tb->GetNdata()); + // if (GetInfo()) { + // GetInfo()->PrintValue(GetName(), fObject, fID, -1, lenmax); + // } + } + + // }; + printf("esco qui\n"); +}; + + +void FEVdetector::ShowInfo(TString detector){ + // + TBranch *b1 = 0; + TBranch *b3 = 0; + TObjArray *branch_array = 0; + TObjArray *leaf_array = 0; + // + b1 = otr->FindBranch(detector.Data()); + Int_t dlen = 44; + // + printf("======> EVENT:%i\n", thisentry); + // + printf("Branch %s\n",b1->GetName()); + branch_array = b1->GetListOfBranches(); + // + Int_t j = 0; + // + for(Int_t l=0;l<(branch_array->GetLast()+1);l++){ + // + TBranchElement *tb = (TBranchElement*)branch_array->At(l); + Int_t type = tb->GetType(); + Int_t atype = tb->GetStreamerType() - 20; + Int_t len = (tb->GetInfo()->GetLengths())[tb->GetID()]; + Int_t length = min(len,dlen); + // printf("SubBranches : %s type is %i tb getname %s\n",((TBranch*)branch_array->At(l))->GetName(),type,tb->GetName()); + switch (type){ + case 0: + // + // IS A VARIABLE + // + // + // NAME + // + // printf(" ATYPE IS %i \n",atype); + printf(" %-15s =",((TBranch*)branch_array->At(l))->GetName()); + j = 0; + // + // VALUES + // + if ( atype == 3 || atype == -17 ){ + while ( j < length ){ + if ( j < length -1 ){ + printf(" %llu ,",(ULong64_t)tb->GetValue(j,0)); + } else { + printf(" %llu",(ULong64_t)tb->GetValue(j,0)); + }; + j++; + }; + } else { + while ( j < length ){ + if ( j < length -1 ){ + printf(" %f ,",tb->GetValue(j,0)); + } else { + printf(" %f",tb->GetValue(j,0)); + }; + j++; + }; + }; + printf("\n"); + break; + case 3: + // + // IS A TCLONESARRAY + // + printf(" %-15s = %d\n", tb->GetName(), tb->GetNdata()); + // + if ( tb->GetNdata() ){ + + printf(" auiauiaui\n"); + TClonesArray *cl = (TClonesArray*)tb->GetObject(); + // + printf(" name %s\n",cl->GetName()); + // + TClass *myc = cl->GetClass(); + // + TList *lme = myc->GetListOfDataMembers(); + TIter next(lme); + Int_t ls=0; + TBranchElement *tb2 = 0; + printf("la classe %s contiene:\n",myc->GetName()); + while ( (tb2 = (TBranchElement*)next()) ){ + // + printf(" Memeber %i is %s \n",ls,tb2->GetName()); + + Int_t thisoffset = 0; + TRealData *rd = myc->GetRealData(tb2->GetName()); + if ( rd ){ + printf(" rd name %s offset %i \n",rd->GetName(),rd->GetThisOffset()); + thisoffset = rd->GetThisOffset(); + }; + + ls++; + + // }; + + for (Int_t ll=0; llGetEntriesFast();ll++){ + // + printf(" Entry %i 0x%X\n",ll,cl->At(ll)); + + // tb->GetInfo()->PrintValue(rd->GetName(), (char*)cl->At(ll)+thisoffset, 0, ls, 44); + + // printf(" value1 = %i \n",&((*cl->At(ll))<BuildRealData(point); + +// point = (char*)cl->At(ll); + + + + + + // printf(" uncheck 0x%X \n",cl->UncheckedAt(ll)); + + + + // TLeafElement* leaf = (TLeafElement*)(cl->UncheckedAt(ll)); + // Int_t n = n * leaf->GetLenStatic(); + // Int_t n = leaf->GetLenStatic(); + //printf(" len static is %i name %s\n",n,leaf->GetName()); + // TLeaf *foglia = tb2->FindLeaf(tb2->GetName()); + + // printf(" foglia lunga %i 0x%X \n",foglia->GetLen(),foglia); + + // + // char *pointer = (char*)cl->UnchekedAt(ll); + // char *ladd = pointer + offset; + // Int_t *count = (Int_t*)(pointer+((tb2->GetMethods())[ls])); + + + + // printf(" lunghezza del clone secondo getentriesfast %i \n",cl->GetEntriesFast()); + // tb->GetInfo()->PrintValueClones(tb->GetName(), cl, tb->GetID(), tb->GetOffset(), length); + // tb->GetInfo()->PrintValueClones(tb2->GetName(),cl,ls,tb->GetOffset(),44); + // TStreamerElement *aElement = (TStreamerElement *)tb2->GetElement()// Int_t type2 = tb2->GetType(); +// Int_t atype2 = tb2->GetStreamerType() - 20; +// printf(" subsubsubleaves : %s type is %i \n",tb2->GetName(),type2); +// Int_t len2 = (tb2->GetInfo()->GetLengths())[tb2->GetID()]; +// Int_t length2 = min(len2,dlen); +// switch (type2){ +// case 0: +// // +// // IS A VARIABLE +// // +// // +// // NAME +// // +// printf(" ATYPE IS %i \n",atype2); +// printf(" %-15s =",tb2->GetName()); +// j = 0; +// // +// // VALUES +// // +// if ( atype2 == 3 || atype2 == -17 ){ +// while ( j < length2 ){ +// if ( j < length2 -1 ){ +// printf(" %llu ,",(ULong64_t)tb2->GetValue(j,0)); +// } else { +// printf(" %llu",(ULong64_t)tb2->GetValue(j,0)); +// }; +// j++; +// }; +// } else { +// while ( j < length2 ){ +// if ( j < length2 -1 ){ +// printf(" %f ,",tb2->GetValue(j,0)); +// } else { +// printf(" %f",tb2->GetValue(j,0)); +// }; +// j++; +// }; +// }; +// printf("\n"); +// break; +// }; + }; + + }; + }; + + + + + // TBranchElement *p=(TBranchElement*)cl->At(ll); + // Int_t plen = (p->GetInfo()->GetLengths())[p->GetID()]; + // Int_t plen = -1; + // printf("SubBranches : %s plen is %i \n",p->GetName(),plen); + + + + + // TLeafElement* leaf = (TLeafElement*)(p->UncheckedAt(0)); + // printf("xoxoxo leaf : %s plen is %i \n",leaf->GetName(),leaf->GetLen()); + + // Int_t n = tb->GetNdata(); + // n = n * leaf->GetLenStatic(); + // if (tb->GetInfo()) { + // n = 16; + // tb->GetInfo()->PrintValue(tb->GetName(), tb->GetAddress(), atype, n, 44); + //tb->GetObject()->GetInfo()->PrintValue(tb->GetName(), tb->GetObject(), atype, n, lenmax); + // } + + // TClonesArray* clones = (TClonesArray*) cl->At(ll); + // if ( tb->GetInfo() ) { + // tb->GetInfo()->PrintValueClones(tb->GetName(), cl, tb->GetID(), tb->GetOffset(), 44); + // }; + + // b3 = (TBranch*)cl->At(l); + // leaf_array = b3->GetListOfLeaves(); + // for(Int_t l=0;l<(leaf_array->GetLast());l++){ + // printf("Leaf : %s\n",((TLeaf*)leaf_array->At(l))->GetName()); + + + // // TBranch *bcl = (TBranch*)leaf_array->At(l); + // //bcl = b1->GetListOfLeaves(); + // //for(Int_t l=0;l<(leaf_array->GetLast()+1);l++){ + // // printf(" value: %f \n",otr->GetLeaf(((TLeaf*)leaf_array->At(l))->GetName())->GetValue(0)); + // // printf(" value: %f \n",otr->GetLeaf(((TLeaf*)(branch_array->At(l))->GetName()))->GetValue(0)); + // //}; + // }; + + + + + + +// // Int_t n = TMath::Min(10, tb->GetNdata()); +// Int_t n = tb->GetNdata(); +// Int_t atype2 = tb->GetStreamerType() + 20; + +// if (tb->GetStreamerType() == 1) { +// // TVirtualStreamerInfo::kOffsetL + TVirtualStreamerInfo::kChar is +// // printed as a string and could print weird characters. +// // So we print an unsigned char instead (not perfect, but better). +// atype2 = 20 + 11 ; +// printf("qui\n"); +// } +// if (atype2 > 54) { +// // FIXME: More logic required here (like in ReadLeaves) +// printf(">54 %-15s = %d\n", tb->GetName(), tb->GetNdata()); + +// } else { +// if (tb->GetStreamerType() > 20) { +// atype2 -= 20; +// // TObjArray *prova= otr->GetListOfLeaves(); +// // TObjArray* leaf2 = (TObjArray*) prova->UncheckedAt(i); +// //TLeaf* leaf = (TLeaf*)(otr->GetLeaf(tb->GetName())); +// // TLeafElement* leaf = (TLeafElement*)((TLeaf*)(otr->GetListOfLeaves()->UncheckedAt(i))->GetBranch()->UncheckedAt(0)); +// TLeafElement* leaf = (TLeafElement*)(cl->UncheckedAt(0)); +// n = n * leaf->GetLenStatic(); +// } +// if (tb->GetInfo()) { +// // n = 16; +// tb->GetInfo()->PrintValue(tb->GetName(), tb->GetAddress(), atype2, n, 44); +// //tb->GetObject()->GetInfo()->PrintValue(tb->GetName(), tb->GetObject(), atype, n, lenmax); +// } +// }; + + + + + + + +// //cl->First(); + +// b3 = (TBranch*)c1->First(); +// leaf_array = cl->GetListOfLeaves(); +// for(Int_t l=0;l<(leaf_array->GetLast()+1);l++){ +// printf("Leaf : %s\n",((TLeaf*)leaf_array->At(l))->GetName()); +// }; +// // for (Int_t ln=0; lnGetEntriesFast() ;ln++){ +// // + +// // +// // }; + +// TBranchElement *tb2 = (TBranchElement*)cl->UncheckedAt(ln); +// Int_t type2 = tb2->GetType(); +// Int_t atype2 = tb2->GetStreamerType() - 20; +// Int_t len2 = (tb2->GetInfo()->GetLengths())[tb2->GetID()]; +// Int_t length2 = min(len2,dlen); +// printf("SubSubBranches : %s type is %i \n",tb2->GetName(),type2); + +// switch (type2){ +// case 0: +// // +// // IS A VARIABLE +// // +// // +// // NAME +// // +// printf(" ATYPE IS %i \n",atype2); +// printf(" %-15s =",tb2->GetName()); +// j = 0; +// // +// // VALUES +// // +// if ( atype2 == 3 || atype2 == -17 ){ +// while ( j < length2 ){ +// if ( j < length2 -1 ){ +// printf(" %llu ,",(ULong64_t)tb2->GetValue(j,0)); +// } else { +// printf(" %llu",(ULong64_t)tb2->GetValue(j,0)); +// }; +// j++; +// }; +// } else { +// while ( j < length2 ){ +// if ( j < length2 -1 ){ +// printf(" %f ,",tb2->GetValue(j,0)); +// } else { +// printf(" %f",tb2->GetValue(j,0)); +// }; +// j++; +// }; +// }; +// printf("\n"); +// break; +// }; +// //printf(" Element %i name %s\n",ln,cl->GetName()); +// }; + +// TBranchElement *tb = (TBranchElement*)branch_array->At(l); +// Int_t type = tb->GetType(); +// printf("SubBranches : %s type is %i tb getname %s\n",((TBranch*)branch_array->At(l))->GetName(),type,tb->GetName()); +// switch (type){ +// case 0: +// // +// // IS A VARIABLE +// // +// Int_t atype = tb->GetStreamerType() - 20; +// Int_t len = (tb->GetInfo()->GetLengths())[tb->GetID()]; +// Int_t length = min(len,dlen); +// // +// // NAME +// // +// printf(" ATYPE IS %i \n",atype); +// printf(" %-15s =",((TBranch*)branch_array->At(l))->GetName()); +// j = 0; +// // +// // VALUES +// // +// if ( atype == 3 || atype == -17 ){ +// while ( j < length ){ +// if ( j < length -1 ){ +// printf(" %llu ,",(ULong64_t)tb->GetValue(j,0)); +// } else { +// printf(" %llu",(ULong64_t)tb->GetValue(j,0)); +// }; +// j++; +// }; +// } else { +// while ( j < length ){ +// if ( j < length -1 ){ +// printf(" %f ,",tb->GetValue(j,0)); +// } else { +// printf(" %f",tb->GetValue(j,0)); +// }; +// j++; +// }; +// }; +// printf("\n"); + + + break; + }; + // b3 = (TBranch*)branch_array->At(l); + // leaf_array = b1->GetListOfLeaves(); + // for(Int_t l=0;l<(leaf_array->GetLast()+1);l++){ + // printf("Leaf : %s\n",((TLeaf*)leaf_array->At(l))->GetName()); + // printf(" value: %f \n",otr->GetLeaf(((TLeaf*)leaf_array->At(l))->GetName())->GetValue(0)); + // printf(" value: %f \n",otr->GetLeaf(((TLeaf*)(branch_array->At(l))->GetName()))->GetValue(0)); + // }; + // }; + + }; + +}; + + + + + + + + + + + + + + + + + + + + + + + + + + + void FEVdetector::GetGeneralInfo(){ // // Get Orbital Time information and header event number @@ -326,28 +847,37 @@ trcs = (TString)trc.str().c_str(); } else { headcold = headc; - headc = L2->GetOrbitalInfo()->pkt_num; // to be changed as soon as we will have obt in the level2 file! - OBT = L2->GetOrbitalInfo()->OBT; // to be changed as soon as we will have obt in the level2 file! - DOBT = OBT - OOBT; - OOBT = OBT; - if ( thisentry == minevent || DOBT < 0 || (headc-headcold-1)!=0 ) DOBT = 0; - var.etime = OBT; + if ( var.ORB ){ + headc = L2->GetOrbitalInfo()->pkt_num; + OBT = L2->GetOrbitalInfo()->OBT; + DOBT = OBT - OOBT; + OOBT = OBT; + if ( thisentry == minevent || DOBT < 0 || (headc-headcold-1)!=0 ) DOBT = 0; + var.etime = OBT; + } else { + var.etime = 0; + }; // // who gave the trigger? // - calotrig = 0; - if ( L2->GetTrigLevel2()->patterntrig[0] ) calotrig = 1; - toftrig = 0; - if ( L2->GetTrigLevel2()->patterntrig[2] || L2->GetTrigLevel2()->patterntrig[3] || L2->GetTrigLevel2()->patterntrig[4] || L2->GetTrigLevel2()->patterntrig[5] ) toftrig = 1; - s4pulser = 0; - if ( L2->GetTrigLevel2()->patterntrig[1] & (1<<0) ) s4pulser = 1; - // - // TOF and calorimeter when giving a trigger will always set this flag since the time window of the signal is greater than 100 ns. - // S4 sometimes could not set the flag even if the trigger is given. This is a workaround to fix this "bug": - // - if ( !calotrig && !toftrig ) s4pulser = 1; - // - Int_t trigconf = L2->GetTrigLevel2()->trigconf; + Int_t trigconf = 0; + if ( var.TRG ){ + calotrig = 0; + if ( L2->GetTrigLevel2()->patterntrig[0] ) calotrig = 1; + toftrig = 0; + if ( L2->GetTrigLevel2()->patterntrig[2] || L2->GetTrigLevel2()->patterntrig[3] || L2->GetTrigLevel2()->patterntrig[4] || L2->GetTrigLevel2()->patterntrig[5] ) toftrig = 1; + s4pulser = 0; + if ( L2->GetTrigLevel2()->patterntrig[1] & (1<<0) ) s4pulser = 1; + // + // TOF and calorimeter when giving a trigger will always set this flag since the time window of the signal is greater than 100 ns. + // S4 sometimes could not set the flag even if the trigger is given. This is a workaround to fix this "bug": + // + if ( !calotrig && !toftrig ) s4pulser = 1; + // + trigconf = L2->GetTrigLevel2()->trigconf; + } else { + trigconf = 0; + } stringstream trc; trc.str(""); if ( trigconf & (1<<0) ) trc << "TOF1"; @@ -456,7 +986,8 @@ // if ( level.file == -1 ) isOK = gApplication->ProcessLine("filter((TTree *)otr,-1,(Variables &)var);"); // - if ( level.file == 2 ) isOK = gApplication->ProcessLine("filter((PamLevel2 *)L2,2);"); + // if ( level.file == 2 ) isOK = gApplication->ProcessLine("filter((PamLevel2 *)L2,2);"); + if ( level.file == 2 ) isOK = gApplication->ProcessLine("filter();"); // // progress bar in text window // @@ -469,26 +1000,33 @@ // } -void FEVdetector::Load(TTree &mainotr, TFile &mainfile){ +Int_t FEVdetector::Load(TTree &mainotr, TFile &mainfile){ + //Int_t FEVdetector::Load(TChain &mainotr, TFile &mainfile){ file = &mainfile; otr = &mainotr; L2 = new PamLevel2(); // if ( level.file == 2 ){ // otr = L2->LoadPamTrees(file); - otr = L2->GetPamTree(file,"+ALL +CAL1 -TRKh -TRK1"); + printf(" %s \n",ddec.Data()); + // otr->Refresh(); + // otr->Clear(); + // otr = new TTree(); + otr = L2->GetPamTree(file,ddec.Data()); + // + if ( !otr ) return(0); // ******************** // load magnetic field // ******************** - const char *pam_calib = pathtocalibration(); + // const char *pam_calib = pathtocalibration(); // - stringstream magfie; - magfie.str(""); + // stringstream magfie; + // magfie.str(""); // magfie << "/localdisk/mocchiut/test/calib/trk-param/field_param-0/"; - magfie << pam_calib; - magfie << "/trk-param/field_param-0/"; + // magfie << pam_calib; + //magfie << "/trk-param/field_param-0/"; // - L2->GetTrkLevel2()->LoadField(magfie.str().c_str()); + //L2->GetTrkLevel2()->LoadField(magfie.str().c_str()); } else { // // load calorimeter ADC2MIP conversion file @@ -528,7 +1066,6 @@ // }; // - // trigger = new pamela::trigger::TriggerEvent(); eh = new pamela::EventHeader(); @@ -547,7 +1084,7 @@ otr->SetBranchAddress("Trigger", &trigger); otr->SetBranchAddress("Header", &eh); }; - if ( level.file == 2 ){ + if ( level.file == 2 && var.RUN){ // otr->AddFriend("OrbitalInfo", file); // otr->SetBranchAddress("OrbitalInfo", &oinfoL2); runinfo->Read(0ULL); @@ -623,6 +1160,9 @@ printf("Show the Time of Flight detector, LEVEL2 data \n"); }; }; + // + // printf("qua\n"); + return(1); // } @@ -2024,7 +2564,8 @@ ms11b[i] = 0.; } else { ms11b[i] = 1.; - }; }; + }; + }; for ( Int_t i = 0; i<6; i++ ) { mt12[0][i] = tof->tdc[ch12a[i]][hb12a[i]]; mt12[1][i] = tof->tdc[ch12b[i]][hb12b[i]]; @@ -2123,7 +2664,7 @@ // var.tofraw = 0; // - repuntil = L2->GetToFLevel2()->ntrk(); + if ( level.file == 2 ) repuntil = L2->GetToFLevel2()->ntrk(); // printf("repuntil = %i \n",repuntil); //repuntil = L2->GetNTracks(); // @@ -3682,7 +4223,9 @@ pcasp4b->Draw("f"); pcasp4b->Draw(); }; - Float_t alfa = 1.2020334; + // Float_t alfax = 1.2020334; + Float_t alfax = 1.22157778; + Float_t alfay = 1.27393111; Float_t lcrd = 0.1815/2.; Float_t wcrd = 0.008; if ( true ){ @@ -3893,12 +4436,16 @@ // // Float_t cardcx = 0.143168*var.sfx; //Float_t cardcy = 0.1475*var.sfy; - Float_t cardcx = 0.153168*var.sfx; - Float_t cardcy = 0.1575*var.sfy; - Float_t acrdx[4] = {-lcrd*cos(alfa), lcrd*cos(alfa), -lcrd*cos(alfa)+wcrd*sin(alfa), -lcrd*cos(alfa)}; - Float_t acrdy[4] = {-lcrd*sin(alfa), lcrd*sin(alfa), -lcrd*sin(alfa)-wcrd*cos(alfa), -lcrd*sin(alfa)}; - Float_t bcrdx[4] = { lcrd*cos(alfa), lcrd*cos(alfa)+wcrd*sin(alfa), -lcrd*cos(alfa)+wcrd*sin(alfa), lcrd*cos(alfa)}; - Float_t bcrdy[4] = { lcrd*sin(alfa), lcrd*sin(alfa)-wcrd*cos(alfa), -lcrd*sin(alfa)-wcrd*cos(alfa), lcrd*sin(alfa)}; + // + // Float_t cardcx = 0.153168*var.sfx; + // + Float_t cardcx = (0.19123*(1.-lcrd*cos(alfax)))*var.sfx; + // Float_t cardcy = 0.1575*var.sfy; + Float_t cardcy = (0.179212*(1.-lcrd*sin(alfax)))*var.sfy; + Float_t acrdx[4] = {-lcrd*cos(alfax), lcrd*cos(alfax), -lcrd*cos(alfax)+wcrd*sin(alfax), -lcrd*cos(alfax)}; + Float_t acrdy[4] = {-lcrd*sin(alfax), lcrd*sin(alfax), -lcrd*sin(alfax)-wcrd*cos(alfax), -lcrd*sin(alfax)}; + Float_t bcrdx[4] = { lcrd*cos(alfax), lcrd*cos(alfax)+wcrd*sin(alfax), -lcrd*cos(alfax)+wcrd*sin(alfax), lcrd*cos(alfax)}; + Float_t bcrdy[4] = { lcrd*sin(alfax), lcrd*sin(alfax)-wcrd*cos(alfax), -lcrd*sin(alfax)-wcrd*cos(alfax), lcrd*sin(alfax)}; // // CARD3 X/ Y @@ -3958,15 +4505,18 @@ }; if ( true ){ - Float_t acrdx[4] = {-lcrd*cos(alfa), lcrd*cos(alfa), -lcrd*cos(alfa)+wcrd*sin(alfa), -lcrd*cos(alfa)}; - Float_t acrdy[4] = {-lcrd*sin(alfa), lcrd*sin(alfa), -lcrd*sin(alfa)-wcrd*cos(alfa), -lcrd*sin(alfa)}; - Float_t bcrdx[4] = { lcrd*cos(alfa), lcrd*cos(alfa)+wcrd*sin(alfa), -lcrd*cos(alfa)+wcrd*sin(alfa), lcrd*cos(alfa)}; - Float_t bcrdy[4] = { lcrd*sin(alfa), lcrd*sin(alfa)-wcrd*cos(alfa), -lcrd*sin(alfa)-wcrd*cos(alfa), lcrd*sin(alfa)}; + Float_t acrdx[4] = {-lcrd*cos(alfay), lcrd*cos(alfay), -lcrd*cos(alfay)+wcrd*sin(alfay), -lcrd*cos(alfay)}; + Float_t acrdy[4] = {-lcrd*sin(alfay), lcrd*sin(alfay), -lcrd*sin(alfay)-wcrd*cos(alfay), -lcrd*sin(alfay)}; + Float_t bcrdx[4] = { lcrd*cos(alfay), lcrd*cos(alfay)+wcrd*sin(alfay), -lcrd*cos(alfay)+wcrd*sin(alfay), lcrd*cos(alfay)}; + Float_t bcrdy[4] = { lcrd*sin(alfay), lcrd*sin(alfay)-wcrd*cos(alfay), -lcrd*sin(alfay)-wcrd*cos(alfay), lcrd*sin(alfay)}; // // CARD - Y-view // - Float_t cardcx = 0.12*var.sfx; - Float_t cardcy = 0.1475*var.sfy; + // Float_t cardcx = 0.12*var.sfx; + Float_t cardcx = (0.16014*(1.-lcrd*cos(alfay)))*var.sfx; + // Float_t cardcy = 0.178818*var.sfy; + Float_t cardcy = (0.178818*(1.-lcrd*sin(alfay)))*var.sfy; + // Float_t cardcy = 0.1475*var.sfy; // // CARD4 X Y/ // @@ -4532,7 +5082,8 @@ // if ( L2->GetTrkLevel2()->GetNTracks() > 0 ){ for (Int_t nt = 0; nt < L2->GetTrkLevel2()->GetNTracks(); nt++){ - TrkTrack *track = L2->GetTrkLevel2()->GetTrack(nt); + PamTrack *ptrack= L2->GetTrack(nt); + TrkTrack *track = ptrack->GetTrkTrack(); if ( nt == 0 ){ var.rig = 0.; if ( track->al[4] != 0. ) var.rig = 1./track->al[4]; @@ -5045,7 +5596,10 @@ // if ( L2->GetTrkLevel2()->GetNTracks() > 0 ){ for (Int_t nt = 0; nt < L2->GetTrkLevel2()->GetNTracks(); nt++){ - TrkTrack *track = L2->GetTrkLevel2()->GetTrack(nt); + + // TrkTrack *track = L2->GetTrkLevel2()->GetTrack(nt); + PamTrack *ptrack = L2->GetTrack(nt); + TrkTrack *track = ptrack->GetTrkTrack(); Int_t npoint = 100; Float_t zin[100]; Double_t xout[100];