]> git.uio.no Git - u/mrichter/AliRoot.git/commitdiff
histo publishing frequency to amore DB fixed to an editable value (60 s) plus an...
authoramastros <amastros@f7af4fe6-9843-0410-8265-dc069ae4e863>
Sat, 12 Jan 2013 20:50:37 +0000 (20:50 +0000)
committeramastros <amastros@f7af4fe6-9843-0410-8265-dc069ae4e863>
Sat, 12 Jan 2013 20:50:37 +0000 (20:50 +0000)
ITS/ITSSPDVertexDiamondda.cxx
ITS/ITSSPD_VertexQualityTuning_DA.config

index 87e5385414ae59fd27d0041a16901105eee1a617..c886ca28f3aa0989140664735f5b1c63166b27d3 100644 (file)
@@ -33,6 +33,7 @@ extern "C" {
 #include <TPaveText.h>
 #include <TSystem.h>
 #include <TGeoGlobalMagField.h>
+#include <TTimeStamp.h>
 
 #include "AliLog.h"
 #include "AliMagF.h"
@@ -67,14 +68,18 @@ int main(int argc, char **argv) {
  Int_t nEvFirstLoop = 0;
  Int_t nEvAUTOSAVE = 0; 
  Int_t zFiducialRegion=0;
+ Int_t timeWindowExport=0; 
+ Int_t timeErrWindowExport=0; 
+
 
  char name[10][10];
 
  FILE *fpConfig = fopen("ITSSPD_VertexQualityTuning_DA.config","r");
- fscanf(fpConfig,"%s %f\n %s %f\n %s %d\n %s %d \n %s %d \n %s %d \n %s %d",&name[0], &errX, &name[1], &r, &name[2], &minClInner,&name[3], &maxClInner, &name[4],&nEvFirstLoop,&name[5],&nEvAUTOSAVE,&name[6],&zFiducialRegion);
+ fscanf(fpConfig,"%s %f\n %s %f\n %s %d\n %s %d \n %s %d \n %s %d \n %s %d \n %s %d \n %s %d",&name[0], &errX, &name[1], &r, &name[2], &minClInner,&name[3], &maxClInner, &name[4],&nEvFirstLoop,&name[5],&nEvAUTOSAVE,&name[6],&zFiducialRegion, &name[7], &timeWindowExport, &name[8], &timeErrWindowExport);
+
  fclose(fpConfig);
 
- printf("\n\n Mean Vertex quality cuts : \n- errX = %f\n- r = %f\n- minSPD0 = %d maxSPD0 = %d\n- nEventsFirstLoop = %d nEventsAUTOSAVE = %d \n- zFiducialRegion = %d\n\n\n",errX,r,minClInner,maxClInner,nEvFirstLoop,nEvAUTOSAVE,zFiducialRegion);
+ printf("\n\n Mean Vertex quality cuts : \n- errX = %f\n- r = %f\n- minSPD0 = %d maxSPD0 = %d\n- nEventsFirstLoop = %d nEventsAUTOSAVE = %d \n- zFiducialRegion = %d\n- timeWindowExport = %d \n- timeErrWindowExport = %d \n\n\n",errX,r,minClInner,maxClInner,nEvFirstLoop,nEvAUTOSAVE,zFiducialRegion, timeWindowExport, timeErrWindowExport);
 
  /* define data source : this is argument 1 */  
  status=monitorSetDataSource( argv[1] );
@@ -219,7 +224,12 @@ int main(int argc, char **argv) {
 
  gSystem->Exec(Form("rm %s",OUTPUT_FILE));
 
- // Initialization of AMORE sender
+ TTimeStamp *timeStamp;
+ timeStamp->Set();
+ Int_t t1 = timeStamp->GetSec(); 
+ Int_t t2=0; 
+
+// Initialization of AMORE sender
 #ifdef ALI_AMORE
  amore::da::AmoreDA vtxAmore(amore::da::AmoreDA::kSender);
 #endif
@@ -284,20 +294,32 @@ int main(int argc, char **argv) {
       }
      }
      mv->WriteVertices(OUTPUT_FILE);
+
+     timeStamp->Set();
+     t2 = timeStamp->GetSec();
+     
+     
+    
 #ifdef ALI_AMORE
-     // send the histos to AMORE pool
-     amore_status=vtxAmore.Send(mv->GetVertexXY()->GetName(),mv->GetVertexXY());
-     if(amore_status) printf("AMORE XY send status: %d\n",amore_status);
-     TH1D *hProj = mv->GetVertexXY()->ProjectionX();
-     amore_status=vtxAmore.Send(Form("%s_ProjX",mv->GetVertexXY()->GetName()),hProj); 
-     if(amore_status) printf("AMORE X send status: %d\n",amore_status);
-     if(hProj) delete hProj;
-     hProj = mv->GetVertexXY()->ProjectionY();
-     amore_status=vtxAmore.Send(Form("%s_ProjY",mv->GetVertexXY()->GetName()),hProj); 
-     if(amore_status) printf("AMORE Y send status: %d\n",amore_status);
-     if(hProj) hProj->Delete();
-     amore_status=vtxAmore.Send(mv->GetVertexZ()->GetName(),mv->GetVertexZ());
-     if(amore_status) printf("AMORE Z  send status: %d\n",amore_status);
+
+     if (TMath::Abs((t2-t1)-timeWindowExport) < timeErrWindowExport){
+       t1=t2;
+       // send the histos to AMORE pool
+       amore_status=vtxAmore.Send(mv->GetVertexXY()->GetName(),mv->GetVertexXY());
+       if(amore_status) printf("AMORE XY send status: %d\n",amore_status);
+       TH1D *hProj = mv->GetVertexXY()->ProjectionX();
+       amore_status=vtxAmore.Send(Form("%s_ProjX",mv->GetVertexXY()->GetName()),hProj); 
+       if(amore_status) printf("AMORE X send status: %d\n",amore_status);
+       if(hProj) delete hProj;
+       hProj = mv->GetVertexXY()->ProjectionY();
+       amore_status=vtxAmore.Send(Form("%s_ProjY",mv->GetVertexXY()->GetName()),hProj); 
+       if(amore_status) printf("AMORE Y send status: %d\n",amore_status);
+       if(hProj) hProj->Delete();
+       amore_status=vtxAmore.Send(mv->GetVertexZ()->GetName(),mv->GetVertexZ());
+       if(amore_status) printf("AMORE Z  send status: %d\n",amore_status);
+     }
+     if (TMath::Abs(t2-t1)> timeWindowExport) t1=t2;
+
 #endif
     }
 
@@ -331,21 +353,26 @@ int main(int argc, char **argv) {
  mv->WriteVertices(OUTPUT_FILE);
 
 #ifdef ALI_AMORE
- // send the histos to AMORE pool
- amore_status=vtxAmore.Send(mv->GetVertexXY()->GetName(),mv->GetVertexXY());  
- if(amore_status) printf("AMORE XY send status: %d\n",amore_status);
- TH1D *hProj = mv->GetVertexXY()->ProjectionX();
- amore_status=vtxAmore.Send(Form("%s_ProjX",mv->GetVertexXY()->GetName()),hProj);
- if(amore_status) printf("AMORE X send status: %d\n",amore_status);
- if(hProj) delete hProj;
- hProj = mv->GetVertexXY()->ProjectionY();
- amore_status=vtxAmore.Send(Form("%s_ProjY",mv->GetVertexXY()->GetName()),hProj);
- if(amore_status) printf("AMORE Y send status: %d\n",amore_status);
- if(hProj) hProj->Delete();
- amore_status=vtxAmore.Send(mv->GetVertexZ()->GetName(),mv->GetVertexZ());
- if(amore_status) printf("AMORE Z  send status: %d\n",amore_status);
-#endif
+ if (TMath::Abs((t2-t1)-timeWindowExport) < timeErrWindowExport){
+       t1=t2;
+       // send the histos to AMORE pool
+       amore_status=vtxAmore.Send(mv->GetVertexXY()->GetName(),mv->GetVertexXY());  
+       if(amore_status) printf("AMORE XY send status: %d\n",amore_status);
+       TH1D *hProj = mv->GetVertexXY()->ProjectionX();
+       amore_status=vtxAmore.Send(Form("%s_ProjX",mv->GetVertexXY()->GetName()),hProj);
+       if(amore_status) printf("AMORE X send status: %d\n",amore_status);
+       if(hProj) delete hProj;
+       hProj = mv->GetVertexXY()->ProjectionY();
+       amore_status=vtxAmore.Send(Form("%s_ProjY",mv->GetVertexXY()->GetName()),hProj);
+       if(amore_status) printf("AMORE Y send status: %d\n",amore_status);
+       if(hProj) hProj->Delete();
+       amore_status=vtxAmore.Send(mv->GetVertexZ()->GetName(),mv->GetVertexZ());
+       if(amore_status) printf("AMORE Z  send status: %d\n",amore_status);
+ }
+ if (TMath::Abs(t2-t1)> timeWindowExport) t1=t2;
 
+#endif
+       
  delete mv;
 
  /* write report */
index d1313483e3f08b6cf99d12045afbf441671ce92a..fcc0af3acdf62cb67d0ca499d2ecef047eb94a68 100644 (file)
@@ -2,6 +2,8 @@ errX 50
 r 1.5
 nMinClusInner 20
 nMaxClusInner 300
-EvFirstLoop 200
+nEvFirstLoop 200
 nEvAUTOSAVE 50
-zFiducialRegion 60
+zFiducialRegion 60 
+timeWindownExport 60 
+timeErrWindowExport 5