|
|
|
1 |
/** |
/** |
2 |
* Packet Scan |
* Packet Scan |
3 |
* author Marcelli |
* author Marcelli |
29 |
* For compilation: |
* For compilation: |
30 |
* Added function "int main(int argc, char* argv[])" |
* Added function "int main(int argc, char* argv[])" |
31 |
* |
* |
32 |
|
* Version 1.7 |
33 |
|
* Date 7 March 2007 - Malvezzi |
34 |
|
* |
35 |
|
* Description: to read correctly the OBT changed the type of time variables from signed to unsigned |
36 |
|
* |
37 |
* |
* |
38 |
* Description: To show packet type recorded by PAMELA (Packet type vs. OBT) |
* Description: To show packet type recorded by PAMELA (Packet type vs. OBT) |
39 |
* |
* |
46 |
*/ |
*/ |
47 |
|
|
48 |
|
|
49 |
|
#include <stdio.h> |
50 |
|
#include <string.h> |
51 |
#include <fstream> |
#include <fstream> |
52 |
#include <sstream> |
#include <sstream> |
53 |
#include <iostream> |
#include <iostream> |
65 |
|
|
66 |
using namespace std; |
using namespace std; |
67 |
|
|
68 |
void PacketScan(TString base, TString outDir, TString format) |
void PacketScan(TString base, TString outDir, TString format){ |
|
{ |
|
69 |
|
|
70 |
TFile *file = new TFile(base.Data()); |
TFile *file = new TFile(base.Data()); |
71 |
|
|
82 |
pamela::EventHeader *eh = 0; |
pamela::EventHeader *eh = 0; |
83 |
pamela::PscuHeader *ph = 0; |
pamela::PscuHeader *ph = 0; |
84 |
|
|
85 |
Float_t obt[1]={0}; |
ULong_t utile=0; |
86 |
Float_t id[1]={0}; |
Double_t obt[1]={0}; |
87 |
|
Double_t id[1]={0}; |
88 |
Int_t cont[48]={0}; |
Int_t cont[48]={0}; |
89 |
std::stringstream oss, oss1, oss2, oss3; |
std::stringstream oss, oss1, oss2, oss3; |
90 |
|
|
115 |
TMultiGraph *mg3 = new TMultiGraph(); |
TMultiGraph *mg3 = new TMultiGraph(); |
116 |
mg3->SetTitle(oss.str().c_str()); |
mg3->SetTitle(oss.str().c_str()); |
117 |
TLegend *leg3 = new TLegend(0.87,0.65,0.99,0.99, ""); |
TLegend *leg3 = new TLegend(0.87,0.65,0.99,0.99, ""); |
|
|
|
118 |
|
|
119 |
|
TObject *key = new TObject; |
120 |
|
const char *name; |
121 |
|
char *SoftInfo="SoftInfo"; |
122 |
for (Int_t i=0; i<numkey; i++){ |
for (Int_t i=0; i<numkey; i++){ |
123 |
TObject *key = list->At(i); |
key = list->At(i); |
124 |
char *name=(char *)(key->GetName()); |
name=(char *)(key->GetName()); |
125 |
|
if(strcmp(name,SoftInfo)==0)continue; |
126 |
TTree* tr = (TTree*)file->Get(name); |
TTree* tr = (TTree*)file->Get(name); |
127 |
while((tr->IsZombie())){ |
if (tr->IsZombie()) continue; |
|
i++; |
|
|
TObject *key = list->At(i); |
|
|
char *name=(char *)(key->GetName()); |
|
|
TTree* tr = (TTree*)file->Get(name); |
|
|
} |
|
128 |
Long64_t nevents = tr->GetEntries(); |
Long64_t nevents = tr->GetEntries(); |
129 |
const Int_t size = nevents; |
const Int_t size = nevents; |
130 |
tr->SetBranchAddress("Header", &eh); |
tr->SetBranchAddress("Header", &eh); |
131 |
for (Int_t j = 0; j < size; j++){ |
for (Int_t j = 0; j < size; j++){ |
132 |
tr->GetEntry(j); |
tr->GetEntry(j); |
133 |
ph = eh->GetPscuHeader(); |
ph = eh->GetPscuHeader(); |
134 |
obt[0]= ph->GetOrbitalTime(); |
utile=ph->GetOrbitalTime(); |
135 |
|
obt[0]= utile; |
136 |
id[0]=(ph->GetPacketId1()); |
id[0]=(ph->GetPacketId1()); |
137 |
Int_t type = (int)id[0]; |
Int_t type = (int)id[0]; |
138 |
switch(type){ |
switch(type){ |
269 |
break; |
break; |
270 |
} |
} |
271 |
case 25:{ |
case 25:{ |
272 |
TGraph *graph = new TGraph(1, obt, id); |
TGraph *graph = new TGraph(1,obt,id); |
273 |
graph->SetMarkerColor(33); |
graph->SetMarkerColor(33); |
274 |
graph->SetMarkerStyle(23); |
graph->SetMarkerStyle(23); |
275 |
graph->SetMarkerSize(1.2); |
graph->SetMarkerSize(1.2); |