/[PAMELA software]/eventviewer/flight/src/FEVdetector.cpp
ViewVC logotype

Diff of /eventviewer/flight/src/FEVdetector.cpp

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.1 by mocchiut, Fri Jul 14 14:18:04 2006 UTC revision 1.9 by mocchiut, Mon Feb 12 08:10:34 2007 UTC
# Line 128  void FEVdetector::GetWindow(){ Line 128  void FEVdetector::GetWindow(){
128      ph = eh->GetPscuHeader();      ph = eh->GetPscuHeader();
129      lastevno = (int)ph->Counter;      lastevno = (int)ph->Counter;
130    } else {    } else {
131      lastevno = oinfoL2->pkt_num; // to be changed as soon as we will have pkt_counter in the level2 file!      lastevno = L2->GetOrbitalInfo()->pkt_num; // to be changed as soon as we will have pkt_counter in the level2 file!
132    };    };
133    otr->GetEntry(minevent);    otr->GetEntry(minevent);
134    if ( level.file < 2 ){    if ( level.file < 2 ){
135      ph = eh->GetPscuHeader();      ph = eh->GetPscuHeader();
136      firstevno = (int)ph->Counter;      firstevno = (int)ph->Counter;
137    } else {    } else {
138      firstevno = oinfoL2->pkt_num; // to be changed as soon as we will have pkt_counter in the level2 file!      firstevno = L2->GetOrbitalInfo()->pkt_num; // to be changed as soon as we will have pkt_counter in the level2 file!
139    };    };
140  }  }
141    
# Line 173  int FEVdetector::GetCounter(){ Line 173  int FEVdetector::GetCounter(){
173      return((int)ph->Counter);      return((int)ph->Counter);
174    } else {    } else {
175      //    return(thisentry); // to be changed as soon as we will have pkt_counter in the level2 file!      //    return(thisentry); // to be changed as soon as we will have pkt_counter in the level2 file!
176      return((int)oinfoL2->pkt_num); // to be changed as soon as we will have pkt_counter in the level2 file!      return((int)L2->GetOrbitalInfo()->pkt_num); // to be changed as soon as we will have pkt_counter in the level2 file!
177    };    };
178  }  }
179    
# Line 326  void FEVdetector::GetGeneralInfo(){ Line 326  void FEVdetector::GetGeneralInfo(){
326      trcs = (TString)trc.str().c_str();      trcs = (TString)trc.str().c_str();
327    } else {    } else {
328      headcold = headc;      headcold = headc;
329      headc = oinfoL2->pkt_num; // to be changed as soon as we will have obt in the level2 file!      headc = L2->GetOrbitalInfo()->pkt_num; // to be changed as soon as we will have obt in the level2 file!
330      OBT = oinfoL2->OBT; // 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!
331      DOBT = OBT - OOBT;      DOBT = OBT - OOBT;
332      OOBT = OBT;      OOBT = OBT;
333      if ( thisentry == minevent || DOBT < 0 || (headc-headcold-1)!=0 ) DOBT = 0;      if ( thisentry == minevent || DOBT < 0 || (headc-headcold-1)!=0 ) DOBT = 0;
# Line 336  void FEVdetector::GetGeneralInfo(){ Line 336  void FEVdetector::GetGeneralInfo(){
336      // who gave the trigger?      // who gave the trigger?
337      //      //
338      calotrig = 0;      calotrig = 0;
339      if ( L2->patterntrig[0] ) calotrig = 1;      if ( L2->GetTrigLevel2()->patterntrig[0] ) calotrig = 1;
340      toftrig = 0;      toftrig = 0;
341      if ( L2->patterntrig[2] || L2->patterntrig[3] || L2->patterntrig[4] || L2->patterntrig[5] ) toftrig = 1;      if ( L2->GetTrigLevel2()->patterntrig[2] || L2->GetTrigLevel2()->patterntrig[3] || L2->GetTrigLevel2()->patterntrig[4] || L2->GetTrigLevel2()->patterntrig[5] ) toftrig = 1;
342      s4pulser = 0;      s4pulser = 0;
343      if ( L2->patterntrig[1] & (1<<0) ) s4pulser = 1;      if ( L2->GetTrigLevel2()->patterntrig[1] & (1<<0) ) s4pulser = 1;
344      //      //
345      // TOF and calorimeter when giving a trigger will always set this flag since the time window of the signal is greater than 100 ns.      // TOF and calorimeter when giving a trigger will always set this flag since the time window of the signal is greater than 100 ns.
346      // S4 sometimes could not set the flag even if the trigger is given. This is a workaround to fix this "bug":      // S4 sometimes could not set the flag even if the trigger is given. This is a workaround to fix this "bug":
347      //      //
348      if ( !calotrig && !toftrig ) s4pulser = 1;      if ( !calotrig && !toftrig ) s4pulser = 1;
349      //      //
350      Int_t trigconf = L2->trigconf;      Int_t trigconf = L2->GetTrigLevel2()->trigconf;
351      stringstream trc;      stringstream trc;
352      trc.str("");      trc.str("");
353      if ( trigconf & (1<<0) ) trc << "TOF1";      if ( trigconf & (1<<0) ) trc << "TOF1";
# Line 475  void FEVdetector::Load(TTree &mainotr, T Line 475  void FEVdetector::Load(TTree &mainotr, T
475    L2 = new PamLevel2();    L2 = new PamLevel2();
476    //    //
477    if ( level.file == 2 ){    if ( level.file == 2 ){
478      otr = L2->LoadPamTrees(file);      //    otr = L2->LoadPamTrees(file);
479        otr = L2->GetPamTree(file,"+ALL +CAL1 -TRKh -TRK1");
480      // ********************      // ********************
481      // load magnetic field      // load magnetic field
482      // ********************      // ********************
# Line 483  void FEVdetector::Load(TTree &mainotr, T Line 484  void FEVdetector::Load(TTree &mainotr, T
484      //      //
485      stringstream magfie;      stringstream magfie;
486      magfie.str("");      magfie.str("");
487        //    magfie << "/localdisk/mocchiut/test/calib/trk-param/field_param-0/";
488      magfie << pam_calib;      magfie << pam_calib;
489      magfie << "/trk-param/field_param-0/";      magfie << "/trk-param/field_param-0/";
490      //      //
491      L2->LoadField(magfie.str().c_str());      L2->GetTrkLevel2()->LoadField(magfie.str().c_str());
492    } else {    } else {
493      //      //
494      // load calorimeter ADC2MIP conversion file      // load calorimeter ADC2MIP conversion file
# Line 531  void FEVdetector::Load(TTree &mainotr, T Line 533  void FEVdetector::Load(TTree &mainotr, T
533    trigger = new pamela::trigger::TriggerEvent();    trigger = new pamela::trigger::TriggerEvent();
534    eh = new pamela::EventHeader();    eh = new pamela::EventHeader();
535    ph = new pamela::PscuHeader();    ph = new pamela::PscuHeader();
536    oinfoL2 = new OrbitalInfo();    //  oinfoL2 = new OrbitalInfo();
537    runinfo = new ItoRunInfo(file);    runinfo = new ItoRunInfo(file);
538    //    //
539    de = new pamela::calorimeter::CalorimeterEvent();    de = new pamela::calorimeter::CalorimeterEvent();
# Line 546  void FEVdetector::Load(TTree &mainotr, T Line 548  void FEVdetector::Load(TTree &mainotr, T
548      otr->SetBranchAddress("Header", &eh);      otr->SetBranchAddress("Header", &eh);
549    };    };
550    if ( level.file == 2 ){    if ( level.file == 2 ){
551      otr->AddFriend("OrbitalInfo", file);            //    otr->AddFriend("OrbitalInfo", file);      
552      otr->SetBranchAddress("OrbitalInfo", &oinfoL2);          //    otr->SetBranchAddress("OrbitalInfo", &oinfoL2);        
553      runinfo->Read(0ULL);      runinfo->Read(0ULL);
554    };    };
555    //    //
# Line 815  void FEVdetector::DisplayEvent(){ Line 817  void FEVdetector::DisplayEvent(){
817    //    //
818    // SHOW PALETTE    // SHOW PALETTE
819    //    //
820      thefigure->cd();
821    if ( var.PALETTE ) ShowPalette();    if ( var.PALETTE ) ShowPalette();
822    //    //
823    // SHOW VERBOSE INFOS    // SHOW VERBOSE INFOS
# Line 2021  void FEVdetector::ShowTOF(){ Line 2024  void FEVdetector::ShowTOF(){
2024          ms11b[i] = 0.;          ms11b[i] = 0.;
2025        } else {        } else {
2026          ms11b[i] = 1.;          ms11b[i] = 1.;
2027        };    };        };
2028        };
2029      for ( Int_t i = 0; i<6; i++ ) {      for ( Int_t i = 0; i<6; i++ ) {
2030        mt12[0][i] = tof->tdc[ch12a[i]][hb12a[i]];        mt12[0][i] = tof->tdc[ch12a[i]][hb12a[i]];
2031        mt12[1][i] = tof->tdc[ch12b[i]][hb12b[i]];        mt12[1][i] = tof->tdc[ch12b[i]][hb12b[i]];
# Line 2120  void FEVdetector::ShowTOF(){ Line 2124  void FEVdetector::ShowTOF(){
2124    //    //
2125    var.tofraw = 0;    var.tofraw = 0;
2126    //    //
2127    repuntil = L2->ToFLevel2::ntrk();        if ( level.file == 2 ) repuntil = L2->GetToFLevel2()->ntrk();    
2128    //  printf("repuntil = %i \n",repuntil);    //  printf("repuntil = %i \n",repuntil);
2129    //repuntil = L2->GetNTracks();        //repuntil = L2->GetNTracks();    
2130    //    //
# Line 2135  void FEVdetector::ShowTOF(){ Line 2139  void FEVdetector::ShowTOF(){
2139        //        //
2140        if ( repuntil == 1 || var.tofraw ){        if ( repuntil == 1 || var.tofraw ){
2141          numtr = 0;          numtr = 0;
2142          ptt = L2->GetToFTrkVar(0);          ptt = L2->GetToFLevel2()->GetToFTrkVar(0);
2143          repeat = false;          repeat = false;
2144        } else {        } else {
2145          //          //
2146          //          //
2147          if ( numtr >= repuntil-1 ) repeat = false;          if ( numtr >= repuntil-1 ) repeat = false;
2148          //          //
2149          ptt = L2->GetToFTrkVar(numtr);          ptt = L2->GetToFLevel2()->GetToFTrkVar(numtr);
2150        };        };
2151        //        //
2152        xp11[0] = 0.;        xp11[0] = 0.;
# Line 2158  void FEVdetector::ShowTOF(){ Line 2162  void FEVdetector::ShowTOF(){
2162        //        //
2163        Float_t adc[4][12];        Float_t adc[4][12];
2164        Float_t tdc[4][12];        Float_t tdc[4][12];
2165        L2->GetMatrix(numtr,adc,tdc);        L2->GetToFLevel2()->GetMatrix(numtr,adc,tdc);
2166    
2167        //        //
2168        for ( Int_t i = 0; i<8; i++ ) {          for ( Int_t i = 0; i<8; i++ ) {  
# Line 2168  void FEVdetector::ShowTOF(){ Line 2172  void FEVdetector::ShowTOF(){
2172          if ( adc[ch11b[i]][hb11b[i]] < 1000. ){          if ( adc[ch11b[i]][hb11b[i]] < 1000. ){
2173            ms11b[i] = adc[ch11b[i]][hb11b[i]];            ms11b[i] = adc[ch11b[i]][hb11b[i]];
2174          };          };
2175          xp11[i] = 0.;          //      xp11[i] = 0.;
2176        };        };
2177    
2178        Int_t nmtof = 0;        Int_t nmtof = 0;
# Line 2208  void FEVdetector::ShowTOF(){ Line 2212  void FEVdetector::ShowTOF(){
2212          if ( adc[ch12b[i]][hb12b[i]] < 1000. ) ms12b[i] = adc[ch12b[i]][hb12b[i]];          if ( adc[ch12b[i]][hb12b[i]] < 1000. ) ms12b[i] = adc[ch12b[i]][hb12b[i]];
2213          xp12[i] = 0.;          xp12[i] = 0.;
2214        };            };    
2215          //
2216        xp12[0] = ptt->xtofpos[0];        xp12[0] = ptt->xtofpos[0];
2217        //        //
2218        ii = 2;        ii = 2;
# Line 2215  void FEVdetector::ShowTOF(){ Line 2220  void FEVdetector::ShowTOF(){
2220          ii--;          ii--;
2221          if ( adc[ch21a[i]][hb21a[i]] < 1000. ) ms21a[ii] = adc[ch21a[i]][hb21a[i]];          if ( adc[ch21a[i]][hb21a[i]] < 1000. ) ms21a[ii] = adc[ch21a[i]][hb21a[i]];
2222          if ( adc[ch21b[i]][hb21b[i]] < 1000. ) ms21b[ii] = adc[ch21b[i]][hb21b[i]];          if ( adc[ch21b[i]][hb21b[i]] < 1000. ) ms21b[ii] = adc[ch21b[i]][hb21b[i]];
2223          xp12[i] = 0.;          xp21[i] = 0.;
2224        };        };
2225        xp21[0] = ptt->xtofpos[1];        xp21[0] = ptt->xtofpos[1];
2226        //        //
# Line 2801  void FEVdetector::ShowAC(){ Line 2806  void FEVdetector::ShowAC(){
2806    // full infos from ac    // full infos from ac
2807    //    //
2808    if ( level.file == 2 ){    if ( level.file == 2 ){
2809      hitmapA = L2->hitmap[0];      hitmapA = L2->GetAcLevel2()->hitmap[0];
2810      hitmapB = L2->hitmap[1];      hitmapB = L2->GetAcLevel2()->hitmap[1];
2811      hitstatusA = L2->hitstatus[0];      hitstatusA = L2->GetAcLevel2()->hitstatus[0];
2812      hitstatusB = L2->hitstatus[1];      hitstatusB = L2->GetAcLevel2()->hitstatus[1];
2813    };    };
2814    //    //
2815    //    //
# Line 4061  void FEVdetector::ShowS4(Bool_t upd){ Line 4066  void FEVdetector::ShowS4(Bool_t upd){
4066    //    //
4067    if ( level.file == 2 ){    if ( level.file == 2 ){
4068      for ( Int_t j = 0; j<3; j++ ) {              for ( Int_t j = 0; j<3; j++ ) {        
4069        if ( L2->S4adc != 32. ) ms4[j] = L2->S4calibrated;        if ( L2->GetS4Level2()->S4adc != 32. ) ms4[j] = L2->GetS4Level2()->S4calibrated;
4070      };              };        
4071    };    };
4072    //        //    
# Line 4146  void FEVdetector::ShowND(){ Line 4151  void FEVdetector::ShowND(){
4151      };      };
4152    };    };
4153    if ( level.file == 2 ){    if ( level.file == 2 ){
4154      yUpperTrig = (Int_t)L2->trigPhysics;      yUpperTrig = (Int_t)L2->GetNDLevel2()->trigPhysics;
4155      yUpperBk = (Int_t)L2->upperBack;      yUpperBk = (Int_t)L2->GetNDLevel2()->upperBack;
4156      yBottomBk = (Int_t)L2->bottomBack;      yBottomBk = (Int_t)L2->GetNDLevel2()->bottomBack;
4157    };    };
4158    //    //
4159    var.trup = yUpperTrig;    var.trup = yUpperTrig;
# Line 4455  void FEVdetector::ShowTRK(Bool_t upd){ Line 4460  void FEVdetector::ShowTRK(Bool_t upd){
4460        //        //
4461        // singlets X        // singlets X
4462        //        //
4463        for (Int_t sing = 0; sing < L2->nclsx(); sing++){        for (Int_t sing = 0; sing < L2->GetTrkLevel2()->nclsx(); sing++){
4464          TClonesArray &t = *(L2->SingletX);          TClonesArray &t = *(L2->GetTrkLevel2()->SingletX);
4465          TrkSinglet *singlet = (TrkSinglet*)t[sing];          TrkSinglet *singlet = (TrkSinglet*)t[sing];
4466          x = (singlet->coord[0]+singlet->coord[1])/2.;                            x = (singlet->coord[0]+singlet->coord[1])/2.;                  
4467          //          //
# Line 4480  void FEVdetector::ShowTRK(Bool_t upd){ Line 4485  void FEVdetector::ShowTRK(Bool_t upd){
4485        //        //
4486        // singlets Y        // singlets Y
4487        //        //
4488        for (Int_t sing = 0; sing < L2->nclsy(); sing++){        for (Int_t sing = 0; sing < L2->GetTrkLevel2()->nclsy(); sing++){
4489          TClonesArray &t = *(L2->SingletY);          TClonesArray &t = *(L2->GetTrkLevel2()->SingletY);
4490          TrkSinglet *singlet = (TrkSinglet*)t[sing];          TrkSinglet *singlet = (TrkSinglet*)t[sing];
4491          //          //
4492          Int_t planepad = (singlet->plane - 1)* 2;          Int_t planepad = (singlet->plane - 1)* 2;
# Line 4526  void FEVdetector::ShowTRK(Bool_t upd){ Line 4531  void FEVdetector::ShowTRK(Bool_t upd){
4531          dcol = 2;          dcol = 2;
4532        };        };
4533        //        //
4534        if ( L2->GetNTracks() > 0 ){        if ( L2->GetTrkLevel2()->GetNTracks() > 0 ){
4535          for (Int_t nt = 0; nt < L2->GetNTracks(); nt++){          for (Int_t nt = 0; nt < L2->GetTrkLevel2()->GetNTracks(); nt++){
4536            TrkTrack *track = L2->GetTrack(nt);              TrkTrack *track = L2->GetTrkLevel2()->GetTrack(nt);  
4537            if ( nt == 0 ){            if ( nt == 0 ){
4538              var.rig = 0.;              var.rig = 0.;
4539              if ( track->al[4] != 0. ) var.rig = 1./track->al[4];              if ( track->al[4] != 0. ) var.rig = 1./track->al[4];
# Line 4624  void FEVdetector::ShowTRK(Bool_t upd){ Line 4629  void FEVdetector::ShowTRK(Bool_t upd){
4629        //        //
4630        // first of all plot crosses relatives to tracks        // first of all plot crosses relatives to tracks
4631        //        //
4632        if ( L2->GetNTracks() > 0 ){        if ( L2->GetTrkLevel2()->GetNTracks() > 0 ){
4633          for (Int_t nt = 0; nt < L2->GetNTracks(); nt++){          for (Int_t nt = 0; nt < L2->GetTrkLevel2()->GetNTracks(); nt++){
4634            TrkTrack *track = L2->GetTrack(nt);              TrkTrack *track = L2->GetTrkLevel2()->GetTrack(nt);  
4635            for (Int_t plane = 0; plane<6; plane++){            for (Int_t plane = 0; plane<6; plane++){
4636              //              //
4637              x = track->xm[plane];              x = track->xm[plane];
# Line 4672  void FEVdetector::ShowTRK(Bool_t upd){ Line 4677  void FEVdetector::ShowTRK(Bool_t upd){
4677        //        //
4678        // try to plot crosses relative to singlets        // try to plot crosses relative to singlets
4679        //        //
4680        if ( L2->nclsx() > 0 && L2->nclsy() > 0 ){        if ( L2->GetTrkLevel2()->nclsx() > 0 && L2->GetTrkLevel2()->nclsy() > 0 ){
4681          for (Int_t plane = 1; plane<7; plane++){          for (Int_t plane = 1; plane<7; plane++){
4682            //            //
4683            // count how many singlet in the x and y view for this plane:            // count how many singlet in the x and y view for this plane:
# Line 4686  void FEVdetector::ShowTRK(Bool_t upd){ Line 4691  void FEVdetector::ShowTRK(Bool_t upd){
4691            TArrayF *array2 = new TArrayF(5000);            TArrayF *array2 = new TArrayF(5000);
4692            TArrayF *sigarrax = new TArrayF(5000);            TArrayF *sigarrax = new TArrayF(5000);
4693            TArrayF *sigarray = new TArrayF(5000);            TArrayF *sigarray = new TArrayF(5000);
4694            for (Int_t sing = 0; sing < L2->nclsx(); sing++){            for (Int_t sing = 0; sing < L2->GetTrkLevel2()->nclsx(); sing++){
4695              TClonesArray &t = *(L2->SingletX);              TClonesArray &t = *(L2->GetTrkLevel2()->SingletX);
4696              TrkSinglet *singlet = (TrkSinglet*)t[sing];              TrkSinglet *singlet = (TrkSinglet*)t[sing];
4697              if ( singlet->plane == plane ){              if ( singlet->plane == plane ){
4698                arrax->AddAt(((singlet->coord[0]+singlet->coord[1])/2.),totsx);                arrax->AddAt(((singlet->coord[0]+singlet->coord[1])/2.),totsx);
# Line 4716  void FEVdetector::ShowTRK(Bool_t upd){ Line 4721  void FEVdetector::ShowTRK(Bool_t upd){
4721                totsx++;                      totsx++;      
4722              };              };
4723            };            };
4724            for (Int_t sing = 0; sing < L2->nclsy(); sing++){            for (Int_t sing = 0; sing < L2->GetTrkLevel2()->nclsy(); sing++){
4725              TClonesArray &t = *(L2->SingletY);              TClonesArray &t = *(L2->GetTrkLevel2()->SingletY);
4726              TrkSinglet *singlet = (TrkSinglet*)t[sing];              TrkSinglet *singlet = (TrkSinglet*)t[sing];
4727              if ( singlet->plane == plane ){              if ( singlet->plane == plane ){
4728                array1->AddAt(singlet->coord[0],totsy);                array1->AddAt(singlet->coord[0],totsy);
# Line 4942  void FEVdetector::ShowTrack(){ Line 4947  void FEVdetector::ShowTrack(){
4947    //    //
4948    //    //
4949    //    //
4950      if ( var.CALO && false ){
4951        if ( L2->GetCaloLevel2()->npcfit[0] > 0 && L2->GetCaloLevel2()->npcfit[1] > 0 ){
4952          Float_t calx[22];
4953          Float_t caly[22];
4954          Float_t calzx[22];
4955          Float_t calzy[22];
4956          Float_t zpiano[22];
4957          zpiano[0] = (CTZ+118.)*var.sfy/1000.;
4958          for (Int_t plane = 1; plane < 22; plane++){      
4959            if ( !(plane%2) ){
4960              zpiano[plane] = zpiano[plane-1] - 8.09*var.sfy/1000.;
4961            }else {
4962              zpiano[plane] = zpiano[plane-1] - 10.09*var.sfy/1000.;
4963            };
4964          };
4965          for (Int_t plane = 0; plane < 22; plane++){      
4966            calx[plane] = (L2->GetCaloLevel2()->cbar[plane][0]/100.)*var.sfx + var.xxvc;;
4967            caly[plane] = (L2->GetCaloLevel2()->cbar[plane][1]/100.)*var.sfx + var.xyvc;
4968            //      calzx[plane] = zpiano[plane] -5.81*var.sfy/1000. + var.yxvc;
4969            calzx[plane] = zpiano[plane] + var.yxvc;
4970            calzy[plane] = zpiano[plane] + var.yyvc;
4971            //      printf(" calx %f caly %f calzx %f calzy %f \n",calx[plane],caly[plane],calzx[plane],calzy[plane]);
4972          };
4973          //
4974          // Calorimeter track
4975          //
4976          Int_t trcol = 30;
4977          if ( var.bw ){
4978            trcol = 14;
4979          } else {
4980            trcol = 44;
4981          };
4982          thefigure->cd();
4983          TPolyLine *trakx = new TPolyLine(22,calx,calzx);
4984          trakx->SetLineColor(trcol);
4985          if ( L2->GetCaloLevel2()->fitmode[0] == 1 ) trakx->SetLineStyle(3);
4986          if ( L2->GetCaloLevel2()->fitmode[0] == 2 ) trakx->SetLineStyle(4);
4987          trakx->SetLineWidth(2);
4988          trakx->Draw();
4989          TPolyLine *traky = new TPolyLine(22,caly,calzy);
4990          traky->SetLineColor(trcol);
4991          if ( L2->GetCaloLevel2()->fitmode[1] == 1 ) traky->SetLineStyle(3);
4992          if ( L2->GetCaloLevel2()->fitmode[1] == 2 ) traky->SetLineStyle(4);
4993          traky->SetLineWidth(2);
4994          traky->Draw();      
4995        };
4996        if ( L2->GetCaloLevel2()->npcfit[2] > 0 ){
4997          Float_t calx[22];
4998          Float_t caly[22];
4999          Float_t calzx[22];
5000          Float_t calzy[22];
5001          Float_t zpiano[22];
5002          zpiano[0] = (CTZ+118.)*var.sfy/1000.;
5003          for (Int_t plane = 1; plane < 22; plane++){      
5004            if ( !(plane%2) ){
5005              zpiano[plane] = zpiano[plane-1] - 8.09*var.sfy/1000.;
5006            }else {
5007              zpiano[plane] = zpiano[plane-1] - 10.09*var.sfy/1000.;
5008            };
5009          };
5010          //
5011          //
5012          CaloTrkVar *ctra = L2->GetCaloStoredTrack(-1);
5013          //
5014          for (Int_t plane = 0; plane < 22; plane++){      
5015            calx[plane] = (ctra->tbar[plane][0]/100.)*var.sfx + var.xxvc;;
5016            caly[plane] = (ctra->tbar[plane][1]/100.)*var.sfx + var.xyvc;
5017            //      calzx[plane] = zpiano[plane] -5.81*var.sfy/1000. + var.yxvc;
5018            calzx[plane] = zpiano[plane] + var.yxvc;
5019            calzy[plane] = zpiano[plane] + var.yyvc;
5020            //      printf(" calx %f caly %f calzx %f calzy %f \n",calx[plane],caly[plane],calzx[plane],calzy[plane]);
5021          };
5022          //
5023          // Calorimeter track
5024          //
5025          Int_t trcol = 30;
5026          if ( var.bw ){
5027            trcol = 16;
5028          } else {
5029            trcol = 46;
5030          };
5031          thefigure->cd();
5032          TPolyLine *trakx = new TPolyLine(22,calx,calzx);
5033          trakx->SetLineColor(trcol);
5034          trakx->SetLineStyle(3);
5035          trakx->SetLineWidth(2);
5036          trakx->Draw();
5037          TPolyLine *traky = new TPolyLine(22,caly,calzy);
5038          traky->SetLineColor(trcol);
5039          traky->SetLineStyle(3);
5040          traky->SetLineWidth(2);
5041          traky->Draw();      
5042        };
5043      };
5044      //
5045    if ( !var.TRK || level.file != 2 ) return;    if ( !var.TRK || level.file != 2 ) return;
5046    //    //
5047    if ( L2->GetNTracks() > 0 ){    if ( L2->GetTrkLevel2()->GetNTracks() > 0 ){
5048      for (Int_t nt = 0; nt < L2->GetNTracks(); nt++){      for (Int_t nt = 0; nt < L2->GetTrkLevel2()->GetNTracks(); nt++){
5049        TrkTrack *track = L2->GetTrack(nt);        TrkTrack *track = L2->GetTrkLevel2()->GetTrack(nt);
5050        Int_t npoint = 100;        Int_t npoint = 100;
5051        Float_t zin[100];        Float_t zin[100];
5052        Double_t xout[100];        Double_t xout[100];
# Line 5016  void FEVdetector::ShowTrack(){ Line 5116  void FEVdetector::ShowTrack(){
5116            };            };
5117            tzx[e] = (0.112)*var.sfy+((float)zin[e]/100.)*var.sfy + var.yxvc;                            tzx[e] = (0.112)*var.sfy+((float)zin[e]/100.)*var.sfy + var.yxvc;                
5118            tzy[e] = (0.112)*var.sfy+((float)zin[e]/100.)*var.sfy + var.yyvc;            tzy[e] = (0.112)*var.sfy+((float)zin[e]/100.)*var.sfy + var.yyvc;
5119              //      printf("tx[e] %f ty [e] %f tzx %f tzy %f \n",tx[e],ty[e],tzx[e],tzy[e]);
5120          };          };
5121          //          //
5122          // From S1 to CALO          // From S1 to CALO
# Line 5565  void FEVdetector::ShowCalo(Bool_t upd){ Line 5666  void FEVdetector::ShowCalo(Bool_t upd){
5666      //      //
5667      stringstream xvev;      stringstream xvev;
5668      stringstream yvev;          stringstream yvev;    
5669      for (Int_t ii = 0; ii < L2->nstrip; ii++){      for (Int_t ii = 0; ii < L2->GetCaloLevel2()->nstrip; ii++){
5670        Int_t colo;        Int_t colo;
5671        Int_t l;        Int_t l;
5672        Int_t m;        Int_t m;
5673        Int_t n;        Int_t n;
5674        Float_t mip = L2->DecodeEstrip(ii,l,m,n);        Float_t mip = L2->GetCaloLevel1()->DecodeEstrip(ii,l,m,n);
5675        if ( var.bw ){        if ( var.bw ){
5676          colo = -1;          colo = -1;
5677        } else {        } else {
# Line 5604  void FEVdetector::ShowCalo(Bool_t upd){ Line 5705  void FEVdetector::ShowCalo(Bool_t upd){
5705      };      };
5706      pd1->Update();      pd1->Update();
5707      pd2->Update();      pd2->Update();
5708      var.qtot=(int)L2->qtot;      var.qtot=(int)L2->GetCaloLevel2()->qtot;
5709      var.nstrip=(int)L2->nstrip;      var.nstrip=(int)L2->GetCaloLevel2()->nstrip;
5710    };    };
5711  }  }
5712    

Legend:
Removed from v.1.1  
changed lines
  Added in v.1.9

  ViewVC Help
Powered by ViewVC 1.1.23