/[PAMELA software]/DarthVader/OrbitalInfo/src/OrbitalInfoCore.cpp
ViewVC logotype

Diff of /DarthVader/OrbitalInfo/src/OrbitalInfoCore.cpp

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

revision 1.17 by mocchiut, Fri Apr 27 10:35:35 2007 UTC revision 1.22 by mocchiut, Tue May 22 08:15:07 2007 UTC
# Line 291  int OrbitalInfoCore(UInt_t run, TFile *f Line 291  int OrbitalInfoCore(UInt_t run, TFile *f
291    // number of run to be processed    // number of run to be processed
292    //    //
293    numbofrun = runinfo->GetNoRun();    numbofrun = runinfo->GetNoRun();
294      UInt_t totnorun = runinfo->GetRunEntries();
295    //    //
296    // Try to access the OrbitalInfo tree in the file, if it exists we are reprocessing data if not we are processing a new run    // Try to access the OrbitalInfo tree in the file, if it exists we are reprocessing data if not we are processing a new run
297    //    //
# Line 317  int OrbitalInfoCore(UInt_t run, TFile *f Line 318  int OrbitalInfoCore(UInt_t run, TFile *f
318      //      //
319      if (verbose) printf("\n Preparing the pre-processing...\n");      if (verbose) printf("\n Preparing the pre-processing...\n");
320      //      //
321      if ( run == 0 ){      if ( run == 0 || totnorun == 1 ){
322        //        //
323        // we are reprocessing all the file        // we are reprocessing all the file
324        // if we are reprocessing everything we don't need to copy any old event and we can just work with the new tree and delete the old one immediately        // if we are reprocessing everything we don't need to copy any old event and we can just work with the new tree and delete the old one immediately
# Line 490  int OrbitalInfoCore(UInt_t run, TFile *f Line 491  int OrbitalInfoCore(UInt_t run, TFile *f
491        code = -11;        code = -11;
492        goto closeandexit;        goto closeandexit;
493      };      };
494      //      //
495      if ( runinfo->EV_TO > nevents-1 ) {      if ( runinfo->EV_TO > nevents-1 ) {
496        if ( debug ) printf(" OrbitalInfo - ERROR: too few entries in the registry tree\n");        if ( debug ) printf(" OrbitalInfo - ERROR: too few entries in the registry tree\n");
497        l0File->Close();        l0File->Close();
# Line 515  int OrbitalInfoCore(UInt_t run, TFile *f Line 516  int OrbitalInfoCore(UInt_t run, TFile *f
516            
517      l0trm = (TTree*)l0File->Get("Mcmd");      l0trm = (TTree*)l0File->Get("Mcmd");
518      neventsm = l0trm->GetEntries();      neventsm = l0trm->GetEntries();
519        //    neventsm = 0;
520      //      //
521      if (neventsm == 0){      if (neventsm == 0){
522        if ( debug ) printf("InclinationInfo - ERROR: No quaternions in this File");        if ( debug ) printf("InclinationInfo - WARNING: No quaternions in this File");
523        l0File->Close();        //      l0File->Close();
524        code = -13;        code = 900;
525        goto closeandexit;        //      goto closeandexit;
526      }      }
527      //      //
528            
529      l0trm->SetBranchAddress("Mcmd", &mcmdev);      l0trm->SetBranchAddress("Mcmd", &mcmdev);
530      l0trm->SetBranchAddress("Header", &eh);      //    l0trm->SetBranchAddress("Header", &eh);
531      //      //
532      //      //
533      //      //
# Line 566  int OrbitalInfoCore(UInt_t run, TFile *f Line 568  int OrbitalInfoCore(UInt_t run, TFile *f
568        //        //
569        if ( (atime > runinfo->RUNTRAILER_TIME) || (atime < runinfo->RUNHEADER_TIME)  ) {        if ( (atime > runinfo->RUNTRAILER_TIME) || (atime < runinfo->RUNHEADER_TIME)  ) {
570          if (verbose) printf(" OrbitalInfo - WARNING: event at time outside the run time window, skipping it\n");          if (verbose) printf(" OrbitalInfo - WARNING: event at time outside the run time window, skipping it\n");
571          debug = true;  //      debug = true;
572          continue;          continue;
573        }        }
574        //        //
# Line 578  int OrbitalInfoCore(UInt_t run, TFile *f Line 580  int OrbitalInfoCore(UInt_t run, TFile *f
580        //        //
581        // Fill OBT, pkt_num and absTime        // Fill OBT, pkt_num and absTime
582        //              //      
583        ph = eh->GetPscuHeader();        //      ph = eh->GetPscuHeader();
584        orbitalinfo->pkt_num = ph->GetCounter();        orbitalinfo->pkt_num = ph->GetCounter();
585        orbitalinfo->OBT = ph->GetOrbitalTime();        orbitalinfo->OBT = ph->GetOrbitalTime();
586        orbitalinfo->absTime = atime;        orbitalinfo->absTime = atime;
# Line 612  int OrbitalInfoCore(UInt_t run, TFile *f Line 614  int OrbitalInfoCore(UInt_t run, TFile *f
614        //        //
615        cOrbit orbits(*gltle->GetTle());        cOrbit orbits(*gltle->GetTle());
616        //        //
617          if ( debug ) printf(" I am Here \n");
618          //
619        // synchronize with quaternions data        // synchronize with quaternions data
620        //        //
621        if ( isf ){        if ( isf && neventsm>0 ){
622            if ( debug ) printf(" I am here \n");
623          //          //
624          // First event          // First event
625          //          //
# Line 689  int OrbitalInfoCore(UInt_t run, TFile *f Line 694  int OrbitalInfoCore(UInt_t run, TFile *f
694        };        };
695      closethisloop:      closethisloop:
696        //        //
697        if ((atime>(UInt_t)upperqtime)||(atime<(UInt_t)lowerqtime)){        if ( debug ) printf(" I am There \n");
698          //
699          if (((atime>(UInt_t)upperqtime)||(atime<(UInt_t)lowerqtime)) && neventsm>0 ){
700            if ( debug ) printf(" I am there \n");
701          //          //
702          lowerqtime = upperqtime;          lowerqtime = upperqtime;
703          UInt_t maxloop = 100000000;              Long64_t maxloop = 100000000LL;
704          UInt_t mn = 0;          Long64_t mn = 0;
705          bool gh=false;          bool gh=false;
706          ooi=oi;          ooi=oi;
707          if ( verbose ) printf(" OrbitalInfoCore: sync with quaternions data upperqtime %u lowerqtime %u atime %u \n",(UInt_t)upperqtime,(UInt_t)lowerqtime,atime);          if ( verbose ) printf(" OrbitalInfoCore: sync with quaternions data upperqtime %u lowerqtime %u atime %u \n",(UInt_t)upperqtime,(UInt_t)lowerqtime,atime);
# Line 701  int OrbitalInfoCore(UInt_t run, TFile *f Line 709  int OrbitalInfoCore(UInt_t run, TFile *f
709            if ( mn > maxloop ){            if ( mn > maxloop ){
710              if ( verbose ) printf(" OrbitalInfoCore: quaternions sync out of range! exiting\n");              if ( verbose ) printf(" OrbitalInfoCore: quaternions sync out of range! exiting\n");
711              gh = true;              gh = true;
712                neventsm = 0;
713            };            };
714            mn++;            mn++;
715            if (oi<5) oi++;            if (oi<5) oi++;
# Line 745  int OrbitalInfoCore(UInt_t run, TFile *f Line 754  int OrbitalInfoCore(UInt_t run, TFile *f
754          if ( verbose ) printf(" OrbitalInfoCore: sync with quaternions data now we have upperqtime %u lowerqtime %u atime %u \n",(UInt_t)upperqtime,(UInt_t)lowerqtime,atime);          if ( verbose ) printf(" OrbitalInfoCore: sync with quaternions data now we have upperqtime %u lowerqtime %u atime %u \n",(UInt_t)upperqtime,(UInt_t)lowerqtime,atime);
755        };        };
756        //        //
757          if ( debug ) printf(" I am THIS \n");
758          //
759        // Fill in quaternions and angles        // Fill in quaternions and angles
760        //        //
761        if ((atime<=(UInt_t)upperqtime)&&(atime>=(UInt_t)lowerqtime)){            if ((atime<=(UInt_t)upperqtime)&&(atime>=(UInt_t)lowerqtime)&& neventsm>0){      
762            if ( debug ) printf(" I am this \n");
763          UInt_t tut = holeq(lowerqtime, upperqtime, L_QQ_Q_l_lower, L_QQ_Q_l_upper, oi);          UInt_t tut = holeq(lowerqtime, upperqtime, L_QQ_Q_l_lower, L_QQ_Q_l_upper, oi);
764          if (oi == 0){          if (oi == 0){
765            if ((tut!=5)||(tut!=6)){            if ((tut!=5)||(tut!=6)){
# Line 830  int OrbitalInfoCore(UInt_t run, TFile *f Line 842  int OrbitalInfoCore(UInt_t run, TFile *f
842              }              }
843            }                        }            
844          }          }
845            //
846          orbitalinfo->mode = holeq(lowerqtime, upperqtime, L_QQ_Q_l_lower, L_QQ_Q_l_upper, oi);          orbitalinfo->mode = holeq(lowerqtime, upperqtime, L_QQ_Q_l_lower, L_QQ_Q_l_upper, oi);
847                    //
848        } else {        } else {
849            if ( debug ) printf(" ops no incl! \n");
850          orbitalinfo->mode = -1;          orbitalinfo->mode = -1;
851        };        };
852        
# Line 878  int OrbitalInfoCore(UInt_t run, TFile *f Line 892  int OrbitalInfoCore(UInt_t run, TFile *f
892      // Here you may want to clear some variables before processing another run        // Here you may want to clear some variables before processing another run  
893      //      //
894      delete dbtime;      delete dbtime;
895      delete L_QQ_Q_l_upper;      if ( L_QQ_Q_l_upper ) delete L_QQ_Q_l_upper;
896      delete L_QQ_Q_l_lower;      if ( L_QQ_Q_l_lower ) delete L_QQ_Q_l_lower;
897      delete RYPang_upper;      if ( RYPang_upper ) delete RYPang_upper;
898      delete RYPang_lower;      if ( RYPang_lower ) delete RYPang_lower;
899    }; // process all the runs    }; // process all the runs
900        
901    if (verbose) printf("\n Finished processing data \n");    if (verbose) printf("\n Finished processing data \n");

Legend:
Removed from v.1.17  
changed lines
  Added in v.1.22

  ViewVC Help
Powered by ViewVC 1.1.23