/[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.18 by mocchiut, Fri Mar 30 11:16:43 2007 UTC revision 1.24 by mocchiut, Wed Nov 14 16:19:41 2007 UTC
# Line 83  FEVdetector::FEVdetector(TString filenam Line 83  FEVdetector::FEVdetector(TString filenam
83    thefigure = &figure;    thefigure = &figure;
84    checkctrlword();    checkctrlword();
85    var.selex = false;    var.selex = false;
86      var.showall = false;
87    
88      var.showsi = false;
89      var.shownd = false;
90      var.shows4 = false;
91      var.showorb = false;
92      var.showtof = false;
93      var.showtrg = false;
94      var.showtrk = false;
95      var.showcal = false;
96      var.showrun = false;
97      var.showac = false;
98  }  }
99    
100  void FEVdetector::checkctrlword(){  void FEVdetector::checkctrlword(){
# Line 92  void FEVdetector::checkctrlword(){ Line 104  void FEVdetector::checkctrlword(){
104    var.RUN = 1;    var.RUN = 1;
105    var.TRK = 0;    var.TRK = 0;
106    var.ORB = 1;    var.ORB = 1;
107    var.TRG = 0;    var.TRG = 1;
108    var.CALO = 0;    var.CALO = 0;
109    var.CALOT = 0;    var.CALOT = 0;
110    var.S4 = 0;    var.S4 = 0;
# Line 136  void FEVdetector::SetDDEC(TString de){ Line 148  void FEVdetector::SetDDEC(TString de){
148  void FEVdetector::GetWindow(){  void FEVdetector::GetWindow(){
149    //    //
150    if ( level.file == 2 ){    if ( level.file == 2 ){
151        //    printf("0qui\n");
152      L2->GetEntry(minevent);      L2->GetEntry(minevent);
153    } else {    } else {
154      otr->GetEntry(minevent);      otr->GetEntry(minevent);
# Line 152  void FEVdetector::GetWindow(){ Line 165  void FEVdetector::GetWindow(){
165    };    };
166    //    //
167    if ( level.file == 2 ){    if ( level.file == 2 ){
168        //    printf("1qui\n");
169      L2->GetEntry(maxevent);      L2->GetEntry(maxevent);
170    } else {    } else {
171      otr->GetEntry(maxevent);      otr->GetEntry(maxevent);
# Line 193  void FEVdetector::GetEntry(Int_t i){ Line 207  void FEVdetector::GetEntry(Int_t i){
207    thisentry = i;      thisentry = i;  
208    if ( level.file == 2 ){    if ( level.file == 2 ){
209      L2->Clear();      L2->Clear();
210        //    printf("qui\n");
211      L2->GetEntry(i);      L2->GetEntry(i);
212      ShowInfo("RunInfo");      if ( var.showall ){
213      ShowInfo("SoftInfo");        ShowInfo("RunInfo");
214      ShowInfo("OrbitalInfo");        ShowInfo("SoftInfo");
215      ShowInfo("TrigLevel2");        ShowInfo("OrbitalInfo");
216      ShowInfo("ToFLevel2");        ShowInfo("TrigLevel2");
217      ShowInfo("TrkLevel2");        ShowInfo("ToFLevel2");
218      ShowInfo("AcLevel2");        ShowInfo("TrkLevel2");
219      ShowInfo("CaloLevel2");        ShowInfo("AcLevel2");
220      ShowInfo("CaloLevel1");        ShowInfo("CaloLevel2");
221      ShowInfo("S4Level2");        ShowInfo("CaloLevel1");
222      ShowInfo("NDLevel2");        ShowInfo("S4Level2");
223          ShowInfo("NDLevel2");
224        } else {
225          if ( var.showrun ) ShowInfo("RunInfo");
226          if ( var.showsi ) ShowInfo("SoftInfo");
227          if ( var.showorb ) ShowInfo("OrbitalInfo");
228          if ( var.showtrg ) ShowInfo("TrigLevel2");
229          if ( var.showtof ) ShowInfo("ToFLevel2");
230          if ( var.showtrk ) ShowInfo("TrkLevel2");
231          if ( var.showac ) ShowInfo("AcLevel2");
232          if ( var.showcal ) ShowInfo("CaloLevel2");
233          if ( var.showcal ) ShowInfo("CaloLevel1");
234          if ( var.shows4 ) ShowInfo("S4Level2");
235          if ( var.shownd ) ShowInfo("NDLevel2");
236        };
237    } else {    } else {
238      otr->GetEntry(i);      otr->GetEntry(i);
239      ShowInfo("Pscu");      if ( var.showall ){
240      ShowInfo("Trigger");        ShowInfo("Pscu");
241      ShowInfo("Tof");        ShowInfo("Trigger");
242      ShowInfo("Tracker");        ShowInfo("Tof");
243      ShowInfo("Anticounter");        ShowInfo("Tracker");
244      ShowInfo("Calorimeter");        ShowInfo("Anticounter");
245      ShowInfo("Neutron");        ShowInfo("Calorimeter");
246      ShowInfo("S4");        ShowInfo("S4");
247          ShowInfo("Neutron");
248        } else {
249          if ( var.showorb ) ShowInfo("Pscu");
250          if ( var.showtrg ) ShowInfo("Trigger");
251          if ( var.showtof ) ShowInfo("Tof");
252          if ( var.showtrk ) ShowInfo("Tracker");
253          if ( var.showac ) ShowInfo("Anticounter");
254          if ( var.showcal ) ShowInfo("Calorimeter");
255          if ( var.shows4 ) ShowInfo("S4");
256          if ( var.shownd ) ShowInfo("Neutron");
257        };
258    };    };
259  }  }
260    
# Line 1011  int FEVdetector::SelectEvent(){ Line 1051  int FEVdetector::SelectEvent(){
1051    //    //
1052  }  }
1053    
1054  TChain* FEVdetector::Load(TFile &mainfile){  TChain* FEVdetector::Load(TString file){
1055    //    //
1056    file = &mainfile;    //  file = &mainfile;
1057    //    //
1058    if ( level.file == 2 ){    if ( level.file == 2 ){
1059      //      //
1060      printf(" %s \n",ddec.Data());      printf(" %s \n",ddec.Data());
1061      if ( !L2 ){      if ( !L2 ){
1062        L2 = new PamLevel2("",file->GetName(),ddec.Data());        L2 = new PamLevel2("",file.Data(),ddec.Data());
1063        otr = L2->GetPamTree();        otr = L2->GetPamTree();
1064          printf(" l2 constructor\n");
1065          //      printf(" abst %u obt %u qtot %f \n",L2->GetOrbitalInfo()->absTime,L2->GetOrbitalInfo()->OBT,L2->GetCaloLevel2()->qtot);    
1066      } else {      } else {
1067        //        //
1068        otr = L2->GetPamTree(gSystem->DirName(file->GetName()),file->GetName(),ddec.Data());        printf(" l2 already exist \n");
1069        L2->GetRunTree(gSystem->DirName(file->GetName()),file->GetName());        otr = L2->GetPamTree(gSystem->DirName(file.Data()),file.Data(),ddec.Data());
1070          L2->GetRunTree(gSystem->DirName(file.Data()),file.Data());
1071        //        //
1072      };      };
1073      //      //
# Line 1089  TChain* FEVdetector::Load(TFile &mainfil Line 1132  TChain* FEVdetector::Load(TFile &mainfil
1132      tof = new pamela::tof::TofEvent();      tof = new pamela::tof::TofEvent();
1133      //      //
1134      otr = new TChain("Physics");      otr = new TChain("Physics");
1135      otr->Add(file->GetName(),-1);      otr->Add(file.Data(),-1);
1136      otr->SetBranchAddress("Trigger", &trigger);      otr->SetBranchAddress("Trigger", &trigger);
1137      otr->SetBranchAddress("Header", &eh);      otr->SetBranchAddress("Header", &eh);
1138    };    };
# Line 1536  void FEVdetector::DisplayEvent(){ Line 1579  void FEVdetector::DisplayEvent(){
1579    //    //
1580    // print infos on terminal    // print infos on terminal
1581    //    //
1582      //  if ( !var.selex ){
1583    printf(" File: %s \n",var.thefilename.Data());            printf(" File: %s \n",var.thefilename.Data());        
1584    if ( !s4pulser && !calotrig ){    if ( !s4pulser && !calotrig ){
1585      printf(" Pkt_num: %i  - Progressive number: %i \n",(int)headc,thisentry+1);      printf(" Pkt_num: %i  - Progressive number: %i \n",(int)headc,thisentry+1);
# Line 1546  void FEVdetector::DisplayEvent(){ Line 1590  void FEVdetector::DisplayEvent(){
1590    if ( calotrig ){    if ( calotrig ){
1591      printf(" Pkt_num: %i  - Progressive number: %i   - CALO trigger -\n",(int)headc,thisentry+1);      printf(" Pkt_num: %i  - Progressive number: %i   - CALO trigger -\n",(int)headc,thisentry+1);
1592    };    };
1593    printf(" On Board Time: %i (delta %i) [ms]\n",OBT,DOBT);    printf(" On Board Time: %u (delta %i) [ms]\n",OBT,DOBT);
1594    const char *trc2 = trcs;    const char *trc2 = trcs;
1595    printf(" TRIGGER: %s \n",trc2);          printf(" TRIGGER: %s \n",trc2);      
1596    printf(" AC: CARD hit = %i  CAT hit = %i  CAS hit = %i \n",var.hcard,var.hcat,var.hcas);          printf(" AC: CARD hit = %i  CAT hit = %i  CAS hit = %i \n",var.hcard,var.hcat,var.hcas);      
# Line 1558  void FEVdetector::DisplayEvent(){ Line 1602  void FEVdetector::DisplayEvent(){
1602    printf(" CALO: NSTRIP = %i  QTOT = %i [MIP]\n",var.nstrip,var.qtot);      printf(" CALO: NSTRIP = %i  QTOT = %i [MIP]\n",var.nstrip,var.qtot);  
1603    printf(" S4: %.2f [MIP]   TOF: beta = %.2f \n",var.s4sig,var.beta[4]);            printf(" S4: %.2f [MIP]   TOF: beta = %.2f \n",var.s4sig,var.beta[4]);        
1604    printf(" ND: Trigger: neutrons = %i - Background: upper = %i lower = %i \n",var.trup,var.bkup,var.bkbo);          printf(" ND: Trigger: neutrons = %i - Background: upper = %i lower = %i \n",var.trup,var.bkup,var.bkbo);      
1605      //  };
1606    //    //
1607  }  }
1608    
# Line 5116  void FEVdetector::ShowTRK(Bool_t upd){ Line 5161  void FEVdetector::ShowTRK(Bool_t upd){
5161              //              //
5162              x = track->xm[plane];              x = track->xm[plane];
5163              Float_t xsig = track->dedx_x[plane];              Float_t xsig = track->dedx_x[plane];
5164              if ( track->xgood[plane] ){              if ( track->XGood(plane) ){
5165                //if ( x > -100 ){                //if ( x > -100 ){
5166                if ( xsig > 8. ) xsig = 8.;                if ( xsig > 8. ) xsig = 8.;
5167                if ( var.bw ){                if ( var.bw ){
# Line 5146  void FEVdetector::ShowTRK(Bool_t upd){ Line 5191  void FEVdetector::ShowTRK(Bool_t upd){
5191              trkpad[planepad]->Range(-7.05,0.,7.05,8.);              trkpad[planepad]->Range(-7.05,0.,7.05,8.);
5192              x = track->ym[plane];              x = track->ym[plane];
5193              xsig = track->dedx_y[plane];              xsig = track->dedx_y[plane];
5194              if ( track->ygood[plane] ){              if ( track->YGood(plane) ){
5195                //            if ( x > -100 ){                //            if ( x > -100 ){
5196                if ( xsig > 8. ) xsig = 8.;                if ( xsig > 8. ) xsig = 8.;
5197                if ( var.bw ){                if ( var.bw ){
# Line 5210  void FEVdetector::ShowTRK(Bool_t upd){ Line 5255  void FEVdetector::ShowTRK(Bool_t upd){
5255              Float_t xsig = track->dedx_x[plane];              Float_t xsig = track->dedx_x[plane];
5256              Float_t ysig = track->dedx_y[plane];              Float_t ysig = track->dedx_y[plane];
5257              //    if ( x > -100 && y > -100. ){              //    if ( x > -100 && y > -100. ){
5258              if ( track->xgood[plane] && track->ygood[plane] ){              if ( track->XGood(plane) && track->YGood(plane) ){
5259                if ( var.bw ){                if ( var.bw ){
5260                  sigcol1 = -1;                  sigcol1 = -1;
5261                  sigcol2 = -1;                  sigcol2 = -1;

Legend:
Removed from v.1.18  
changed lines
  Added in v.1.24

  ViewVC Help
Powered by ViewVC 1.1.23