FEDRA emulsion software from the OPERA Collaboration
tlg2pattern.C File Reference
#include "Riostream.h"
#include <iostream>
Include dependency graph for tlg2pattern.C:
This graph shows which files directly or indirectly include this file:

Namespaces

 File
 
 File::Format
 
 File::Info
 
 File::Section
 
 Header
 
 Header::Center
 
 Header::Extents
 
 Header::Identifier
 
 Header::Transform
 
 MIPBaseTrack
 
 MIPEmulsionTrack
 
 TrackIndexEntry
 
 View
 

Enumerations

enum  { File::Info::Track = 1 , File::Info::BaseTrack = 2 , File::Info::Field = 3 }
 
enum  { File::Section::Data = 0x20 , File::Section::Header = 0x40 }
 
enum  {
  File::Format::Old = 0x08 , File::Format::Old2 = 0x02 , File::Format::NoExtents = 0x01 , File::Format::Normal = 0x03 ,
  File::Format::NormalWithIndex = 0x04 , File::Format::NormalDouble_tWithIndex = 0x05 , File::Format::Detailed = 0x06 , File::Format::MultiSection = 0x07
}
 
enum  en_side { TOP , BOT , TOP , BOT }
 

Functions

void Add_MIPBaseTrack (int i, EdbPattern &base, EdbPattern &ptop, EdbPattern &pbot, float project_dz=-105.)
 
void Add_MIPEmulsionTrack (en_side side, int i, EdbPattern &ptop, EdbPattern &pbot)
 
void print_Header ()
 
void print_MIPBaseTrack (int i)
 
void print_MIPEmulsionTrack (int s, int i)
 
void print_View (int side, int i)
 
void printrackIndexEntry (int s, int i)
 
void tlg2patterns (const char *input_file, EdbPattern &ptop, EdbPattern &pbot, EdbPattern &base, float project_dz=-105.)
 

Variables

UInt_t MIPEmulsionTrack::AreaSum
 
UInt_t MIPBaseTrack::AreaSum
 
Double_t Header::Bottom_BottomZ
 
Double_t Header::Bottom_TopZ
 
Int_t MIPBaseTrack::BottomId
 
Int_t Header::BottomTracksLength
 
Int_t Header::BottomViewsLength
 
Double_t MIPEmulsionTrack::BottomZ
 
UInt_t MIPEmulsionTrack::Count
 
UInt_t MIPBaseTrack::Count
 
EdbSegCouplecp = 0
 
UInt_t MIPEmulsionTrack::Field
 
Int_t TrackIndexEntry::Fragment
 
UShort_t Header::headerformat
 
UInt_t MIPBaseTrack::id
 
Char_t Header::infotype
 
Double_t Header::Extents::MaxX
 
Double_t Header::Extents::MaxY
 
Double_t Header::Extents::MinX
 
Double_t Header::Extents::MinY
 
Double_t Header::Transform::MXX
 
Double_t Header::Transform::MXY
 
Double_t Header::Transform::MYX
 
Double_t Header::Transform::MYY
 
Int_t Header::Identifier::Part0
 
Int_t Header::Identifier::Part1
 
Int_t Header::Identifier::Part2
 
Int_t Header::Identifier::Part3
 
Int_t Pid1 =0
 
Int_t Pid2 =0
 
Double_t Header::Transform::RX
 
Double_t Header::Transform::RY
 
EdbSegPs = 0
 
EdbSegPs1 = 0
 
EdbSegPs2 = 0
 
const Char_t Header::SectionTag = 0x01
 
Double_t MIPEmulsionTrack::Sigma
 
Double_t MIPBaseTrack::Sigma
 
Double_t MIPEmulsionTrack::SX
 
Double_t MIPBaseTrack::SX
 
Double_t MIPEmulsionTrack::SY
 
Double_t MIPBaseTrack::SY
 
Double_t MIPEmulsionTrack::SZ
 
Double_t MIPBaseTrack::SZ
 
Double_t Header::Top_BottomZ
 
Double_t Header::Top_TopZ
 
Int_t MIPBaseTrack::TopId
 
Int_t Header::TopTracksLength
 
Int_t Header::TopViewsLength
 
Double_t MIPEmulsionTrack::TopZ
 
Int_t TrackIndexEntry::Track
 
Int_t Header::TracksLength
 
Double_t Header::Transform::TX
 
Double_t Header::Transform::TY
 
Int_t TrackIndexEntry::View
 
Int_t MIPEmulsionTrack::viewid
 
Double_t Header::Center::X
 
Double_t MIPEmulsionTrack::X
 
Double_t MIPBaseTrack::X
 
Float_t Xv =0
 
Double_t Header::Center::Y
 
Double_t MIPEmulsionTrack::Y
 
Double_t MIPBaseTrack::Y
 
Float_t Yv =0
 
Double_t MIPEmulsionTrack::Z
 
Double_t MIPBaseTrack::Z
 

Enumeration Type Documentation

◆ en_side

enum en_side
Enumerator
TOP 
BOT 
TOP 
BOT 
37 { TOP , BOT } ;
@ TOP
Definition: tlg2pattern.C:37
@ BOT
Definition: tlg2pattern.C:37

Function Documentation

◆ Add_MIPBaseTrack()

void Add_MIPBaseTrack ( int  i,
EdbPattern base,
EdbPattern ptop,
EdbPattern pbot,
float  project_dz = -105. 
)
236 {
237  using namespace MIPBaseTrack ;
238 
239  EdbSegP* t = ptop.GetSegment(TopId);
240  EdbSegP* b = pbot.GetSegment(BottomId);
241 
242  if(t==0) return;
243  if(b==0) return;
244 
245  float x_ = X + SX*( project_dz ) ;
246  float y_ = Y + SY*( project_dz ) ;
247 
248  float z_ = Z + project_dz ;
249 
250  EdbSegP s( i , x_, y_, SX, SY, Count ) ;
251  s.SetChi2( Sigma ) ;
252  s.SetVolume( AreaSum ) ;
253  s.SetZ( z_ ) ;
254 
255  s.SetAid ( -90 , -90 );
256  s.SetFlag( -90 );
257  s.SetDZ( b->Z() - t->Z() );
258  s.SetDZem( 0 ) ;
259 
260  base.AddSegment(s);
261 }
TTree * t
Definition: check_shower.C:4
Definition: EdbSegP.h:18
void SetVolume(float w)
Definition: EdbSegP.h:133
void SetDZem(float dz)
Definition: EdbSegP.h:124
Float_t Z() const
Definition: EdbSegP.h:150
void SetZ(float z)
Definition: EdbSegP.h:122
void SetChi2(float chi2)
Definition: EdbSegP.h:132
void SetDZ(float dz)
Definition: EdbSegP.h:123
void SetFlag(int flag)
Definition: EdbSegP.h:127
void SetAid(int a, int v, int side=0)
Definition: EdbSegP.h:135
EdbSegP * GetSegment(int i) const
Definition: EdbPattern.h:66
EdbSegP * AddSegment(int i, EdbSegP &s)
Definition: EdbPattern.cxx:71
Definition: tlg2pattern.C:117
Int_t TopId
Definition: tlg2pattern.C:128
UInt_t Count
Definition: tlg2pattern.C:120
Double_t Y
Definition: tlg2pattern.C:122
Double_t Z
Definition: tlg2pattern.C:123
Double_t SX
Definition: tlg2pattern.C:124
Double_t Sigma
Definition: tlg2pattern.C:127
UInt_t AreaSum
Definition: tlg2pattern.C:119
Double_t X
Definition: tlg2pattern.C:121
Double_t SY
Definition: tlg2pattern.C:125
Int_t BottomId
Definition: tlg2pattern.C:129
EdbSegP * s
Definition: tlg2pattern.C:32

◆ Add_MIPEmulsionTrack()

void Add_MIPEmulsionTrack ( en_side  side,
int  i,
EdbPattern ptop,
EdbPattern pbot 
)
204 {
205  using namespace MIPEmulsionTrack ;
206 
207  EdbSegP *s=0;
208  if ( side == TOP) {
209  s = ptop.AddSegment( i , X, Y, SX, SY, Count );
210  s->SetZ( Z );
211  s->SetChi2( Sigma );
212  s->SetVolume( AreaSum ) ;
213 
214  s->SetAid ( -91 , viewid );
215  s->SetFlag( -91 );
216  s->SetDZ( TopZ-BottomZ );
217  s->SetDZem( 0 );
218  }
219 
220  if ( side == BOT) {
221  s = pbot.AddSegment( i , X, Y, SX, SY, Count );
222  s->SetZ( Z );
223  s->SetChi2( Sigma );
224  s->SetVolume( AreaSum ) ;
225 
226  s->SetAid ( -92 , viewid );
227  s->SetFlag( -92 );
228  s->SetDZ( TopZ-BottomZ );
229  s->SetDZem( 0 );
230  }
231  // s->PrintNice();
232 }
Definition: tlg2pattern.C:99
Double_t Z
Definition: tlg2pattern.C:105
Double_t BottomZ
Definition: tlg2pattern.C:111
Double_t Sigma
Definition: tlg2pattern.C:109
Double_t X
Definition: tlg2pattern.C:103
UInt_t AreaSum
Definition: tlg2pattern.C:101
UInt_t Count
Definition: tlg2pattern.C:102
Double_t SY
Definition: tlg2pattern.C:107
Double_t SX
Definition: tlg2pattern.C:106
Int_t viewid
Definition: tlg2pattern.C:113
Double_t TopZ
Definition: tlg2pattern.C:110
Double_t Y
Definition: tlg2pattern.C:104

◆ print_Header()

void print_Header ( )
143 {
144 
145  using namespace Header ;
146  cout << "Header"<< endl;
147  cout << (Int_t) infotype << endl;
148  cout << headerformat << endl;
149 
150  using namespace Header::Identifier;
151  cout << Part0 <<" "<< Part1 <<" "<< Part2 <<" "<< Part3 << endl;
152  using namespace Header::Center;
153  cout << X <<" "<< Y << endl;
154  using namespace Header::Extents ;
155  cout << MinX <<" "<< MaxX <<" "<< MinY <<" "<< MaxY << endl;
156  using namespace Header::Transform ;
157  cout << MXX <<" "<< MXY <<" "<< MYX <<" "<< MYY << endl;
158  cout << TX <<" "<< TY <<" "<< RX <<" "<< RY << endl;
159 
160  using namespace Header;
161  cout << TopViewsLength <<" "<< BottomViewsLength << endl ;
162  cout << TopTracksLength <<" "<< BottomTracksLength <<" "<< TracksLength << endl;
163  cout << Top_TopZ <<" "<< Top_BottomZ <<" "<< Bottom_TopZ <<" "<< Bottom_BottomZ << endl;
164 
165 }
Definition: tlg2pattern.C:77
Definition: tlg2pattern.C:78
Double_t MaxX
Definition: tlg2pattern.C:78
Double_t MinX
Definition: tlg2pattern.C:78
Double_t MinY
Definition: tlg2pattern.C:78
Double_t MaxY
Definition: tlg2pattern.C:78
Definition: tlg2pattern.C:76
Int_t Part1
Definition: tlg2pattern.C:76
Int_t Part3
Definition: tlg2pattern.C:76
Int_t Part0
Definition: tlg2pattern.C:76
Int_t Part2
Definition: tlg2pattern.C:76
Definition: tlg2pattern.C:79
Double_t RX
Definition: tlg2pattern.C:79
Double_t MYX
Definition: tlg2pattern.C:79
Double_t TY
Definition: tlg2pattern.C:79
Double_t MXX
Definition: tlg2pattern.C:79
Double_t TX
Definition: tlg2pattern.C:79
Double_t RY
Definition: tlg2pattern.C:79
Double_t MYY
Definition: tlg2pattern.C:79
Double_t MXY
Definition: tlg2pattern.C:79
Definition: tlg2pattern.C:66
Char_t infotype
Definition: tlg2pattern.C:69
Double_t Bottom_TopZ
Definition: tlg2pattern.C:74
Int_t BottomViewsLength
Definition: tlg2pattern.C:82
UShort_t headerformat
Definition: tlg2pattern.C:70
Int_t TopTracksLength
Definition: tlg2pattern.C:84
Int_t TracksLength
Definition: tlg2pattern.C:86
Double_t Top_TopZ
Definition: tlg2pattern.C:72
Double_t Bottom_BottomZ
Definition: tlg2pattern.C:75
Double_t Top_BottomZ
Definition: tlg2pattern.C:73
Int_t BottomTracksLength
Definition: tlg2pattern.C:85
Int_t TopViewsLength
Definition: tlg2pattern.C:81

◆ print_MIPBaseTrack()

void print_MIPBaseTrack ( int  i)
185 {
186  using namespace MIPBaseTrack ;
187  cout << "MIPBaseTrack " << i <<" "<< id <<" " ;
188  cout << AreaSum <<" "<< Count <<" "
189  << X <<" "<< Y <<" "<< Z <<" "
190  << SX <<" "<< SY <<" "<< SZ <<" "
191  << Sigma <<" "<< TopId <<" "<< BottomId << endl;
192 } ;
Double_t SZ
Definition: tlg2pattern.C:126

◆ print_MIPEmulsionTrack()

void print_MIPEmulsionTrack ( int  s,
int  i 
)
175 {
176  using namespace MIPEmulsionTrack ;
177  cout << "MIPEmulsionTrack " << s <<" "<< i <<" " ;
178  cout << Field <<" "<< AreaSum <<" "<< Count <<" "
179  << X <<" "<< Y <<" "<< Z <<" "
180  << SX <<" "<< SY <<" "<< SZ <<" "
181  << Sigma <<" "<< TopZ <<" "<< BottomZ <<" "<< viewid << endl;
182 } ;
Double_t SZ
Definition: tlg2pattern.C:108
UInt_t Field
Definition: tlg2pattern.C:100

◆ print_View()

void print_View ( int  side,
int  i 
)
168 {
169  using namespace View ;
170  //if (i<2 || i>848)
171  cout << "View " << side <<" "<< id <<" "<< topz <<" "<< bottomz <<" "<< px <<" "<< py << endl;
172 } ;
Double_t py
Definition: tlg2pattern.C:95
Double_t px
Definition: tlg2pattern.C:94
Double_t topz
Definition: tlg2pattern.C:92
Double_t bottomz
Definition: tlg2pattern.C:93
Definition: tlg2pattern.C:90

◆ printrackIndexEntry()

void printrackIndexEntry ( int  s,
int  i 
)
195 {
196  using namespace TrackIndexEntry ;
197  cout << "TrackIndexEntry " << s <<" "<< i <<" "<< TrackIndexEntry::Fragment <<" "
199 } ;
Definition: tlg2pattern.C:133
Int_t View
Definition: tlg2pattern.C:136
Int_t Fragment
Definition: tlg2pattern.C:135
Int_t Track
Definition: tlg2pattern.C:137

◆ tlg2patterns()

void tlg2patterns ( const char *  input_file,
EdbPattern ptop,
EdbPattern pbot,
EdbPattern base,
float  project_dz = -105. 
)
267 {
268  // create dummy variables to read unused field
269  Char_t dummych ;
270  // UShort_t dummyus ;
271  UInt_t dummyui ;
272  Float_t dummyf ;
273  Double_t dummyd ;
274 
275  // Initialize the transformation
284 
285  double minx=-10000000;
286  double maxx=10000000;
287  double miny=-10000000;
288  double maxy=10000000;
289 
290  // Read File
291  //fstream infile(input_file, ios::in | ios::binary);
292  fstream infile(input_file, ios::in | ios::binary);
293 
294  using namespace Header;
295  infile.read( (Char_t*) &infotype , sizeof(Char_t) );
296  infile.read( (Char_t*) &headerformat , sizeof(UShort_t) );
297 
298  if (infotype == ((Char_t) File::Info::Track | (Char_t)File::Section::Header))
299  switch (headerformat)
300  {
301  case (UShort_t) File::Format::MultiSection: break;
302  case (UShort_t) File::Format::Detailed : break;
303  case (UShort_t) File::Format::NormalDouble_tWithIndex : break;
304  case (UShort_t) File::Format::NormalWithIndex : break;
305  case (UShort_t) File::Format::Normal : break;
306  case (UShort_t) File::Format::NoExtents : break;
307  case (UShort_t) File::Format::Old : break;
308  case (UShort_t) File::Format::Old2 : break;
309 
310  default: { cout << "Unknown format\n"; return ; }
311  };
312 
313  if (headerformat == (UShort_t)File::Format::MultiSection)
314  {
315  infile.read( (Char_t*) &dummych , sizeof(Char_t) );
316  if (dummych != SectionTag)
317  {
318  cout << "The first section in a TLG file must contain tracks!" << endl;
319  return;
320  }
321  infile.read( (Char_t*) &dummyd , sizeof(Double_t) );
322  }
323 
328 
329  if (headerformat == (UShort_t) File::Format::Old)
330  {
331  infile.read( (Char_t*) &Identifier::Part3 , sizeof(Int_t) );
333  }
334  else
335  {
336  infile.read( (Char_t*) &Identifier::Part0 , sizeof(Int_t) );
337  infile.read( (Char_t*) &Identifier::Part1 , sizeof(Int_t) );
338  infile.read( (Char_t*) &Identifier::Part2 , sizeof(Int_t) );
339  infile.read( (Char_t*) &Identifier::Part3 , sizeof(Int_t) );
340  }
341 
343  {
344  infile.read( (Char_t*) &Center::X , sizeof(Double_t) );
345  infile.read( (Char_t*) &Center::Y , sizeof(Double_t) );
346  infile.read( (Char_t*) &Extents::MinX , sizeof(Double_t) );
347  infile.read( (Char_t*) &Extents::MaxX , sizeof(Double_t) );
348  infile.read( (Char_t*) &Extents::MinY , sizeof(Double_t) );
349  infile.read( (Char_t*) &Extents::MaxY , sizeof(Double_t) );
350  infile.read( (Char_t*) &Transform::MXX , sizeof(Double_t) );
351  infile.read( (Char_t*) &Transform::MXY , sizeof(Double_t) );
352  infile.read( (Char_t*) &Transform::MYX , sizeof(Double_t) );
353  infile.read( (Char_t*) &Transform::MYY , sizeof(Double_t) );
354  infile.read( (Char_t*) &Transform::TX , sizeof(Double_t) );
355  infile.read( (Char_t*) &Transform::TY , sizeof(Double_t) );
356  infile.read( (Char_t*) &Transform::RX , sizeof(Double_t) );
357  infile.read( (Char_t*) &Transform::RY , sizeof(Double_t) );
358 
359  minx=Extents::MinX;
360  maxx=Extents::MaxX;
361  miny=Extents::MinY;
362  maxy=Extents::MaxY;
363 
364  infile.read( (Char_t*) &TopViewsLength , sizeof(Int_t) ); // n. of View
365  infile.read( (Char_t*) &BottomViewsLength , sizeof(Int_t) ); // n. of View
366  infile.read( (Char_t*) &Top_TopZ , sizeof(Double_t) ); // topext
367  infile.read( (Char_t*) &Top_BottomZ , sizeof(Double_t) ); // topInt_t
368  infile.read( (Char_t*) &Bottom_TopZ , sizeof(Double_t) ); // bottomInt_t
369  infile.read( (Char_t*) &Bottom_BottomZ , sizeof(Double_t) ); // bottomext
370 
371  using namespace View ;
372  for (int s=0; s<2; s++ ) {
373  int nviews = ( s==0 ? TopViewsLength : BottomViewsLength );
374  for (int i=0; i<nviews; i++ ) {
375  infile.read( (Char_t*) &id , sizeof(Int_t) );
376  infile.read( (Char_t*) &px , sizeof(Double_t) );
377  infile.read( (Char_t*) &py , sizeof(Double_t) );
378  infile.read( (Char_t*) &topz , sizeof(Double_t) );
379  infile.read( (Char_t*) &bottomz , sizeof(Double_t) );
380  // print_View( s, i ) ;
381  }
382  }
383 
384  infile.read( (Char_t*) &TopTracksLength , sizeof(Int_t) );
385  infile.read( (Char_t*) &BottomTracksLength , sizeof(Int_t) );
386  infile.read( (Char_t*) &TracksLength , sizeof(Int_t) );
387 
388  //print_Header();
389 
390  using namespace MIPEmulsionTrack ;
391  for (int s=0; s<2; s++ ) {
392  en_side side = ( s==0? TOP : BOT ) ;
393  int ntracks = ( s==0 ? TopTracksLength : BottomTracksLength );
394  for (int i=0; i<ntracks; i++ ) {
395  // 84 bytes
396  infile.read( (Char_t*) &Field , sizeof(UInt_t) );
397  infile.read( (Char_t*) &AreaSum , sizeof(UInt_t) );
398  infile.read( (Char_t*) &Count , sizeof(UInt_t) );
399  infile.read( (Char_t*) &X , sizeof(Double_t) );
400  infile.read( (Char_t*) &Y , sizeof(Double_t) );
401  infile.read( (Char_t*) &Z , sizeof(Double_t) );
402  infile.read( (Char_t*) &SX , sizeof(Double_t) );
403  infile.read( (Char_t*) &SY , sizeof(Double_t) );
404  infile.read( (Char_t*) &SZ , sizeof(Double_t) );
405  infile.read( (Char_t*) &Sigma , sizeof(Double_t) );
406  infile.read( (Char_t*) &TopZ , sizeof(Double_t) );
407  infile.read( (Char_t*) &BottomZ , sizeof(Double_t) );
408  infile.read( (Char_t*) &viewid , sizeof(Int_t) );
409 
410  // print_MIPEmulsionTrack( s, i ) ;
411  if(X<minx-1000) continue;
412  if(X>maxx+1000) continue;
413  if(Y<miny-1000) continue;
414  if(Y>maxy+1000) continue;
415  Add_MIPEmulsionTrack ( side, i, ptop,pbot) ;
416  }
417  }
418 
419  using namespace MIPBaseTrack ;
420  for (int i=0; i<TracksLength; i++ ) {
421  // .. bytes
422  infile.read( (Char_t*) &MIPBaseTrack::AreaSum , sizeof(UInt_t) );
423  infile.read( (Char_t*) &MIPBaseTrack::Count , sizeof(UInt_t) );
424  infile.read( (Char_t*) &MIPBaseTrack::X , sizeof(Double_t) );
425  infile.read( (Char_t*) &MIPBaseTrack::Y , sizeof(Double_t) );
426  infile.read( (Char_t*) &MIPBaseTrack::Z , sizeof(Double_t) );
427  infile.read( (Char_t*) &MIPBaseTrack::SX , sizeof(Double_t) );
428  infile.read( (Char_t*) &MIPBaseTrack::SY , sizeof(Double_t) );
429  infile.read( (Char_t*) &MIPBaseTrack::SZ , sizeof(Double_t) );
430  infile.read( (Char_t*) &MIPBaseTrack::Sigma , sizeof(Double_t) );
431  infile.read( (Char_t*) &MIPBaseTrack::TopId , sizeof(Int_t) );
432  infile.read( (Char_t*) &MIPBaseTrack::BottomId , sizeof(Int_t) );
433 
434  // print_MIPBaseTrack( i ) ;
435  Add_MIPBaseTrack( i , base, ptop, pbot, project_dz) ;
436  }
437 
438  using namespace TrackIndexEntry;
439  for (int s=0; s<2; s++ ) {
440  int ntracks = ( s==0 ? TopTracksLength : BottomTracksLength );
441  for (int i=0; i<ntracks; i++ )
442  {
443  infile.read( (Char_t*) &TrackIndexEntry::Fragment , sizeof(Int_t) );
444  infile.read( (Char_t*) &TrackIndexEntry::View , sizeof(Int_t) );
445  infile.read( (Char_t*) &TrackIndexEntry::Track , sizeof(Int_t) );
446 
447  // printrackIndexEntry( s , i ) ;
448  }
449  }
450  }
451  else if (headerformat == (UShort_t) File::Format::NormalDouble_tWithIndex )
452  {
453  using namespace Header;
454  infile.read( (Char_t*) &Center::X , sizeof(Double_t) );
455  infile.read( (Char_t*) &Center::Y , sizeof(Double_t) );
456  infile.read( (Char_t*) &Extents::MinX , sizeof(Double_t) );
457  infile.read( (Char_t*) &Extents::MaxX , sizeof(Double_t) );
458  infile.read( (Char_t*) &Extents::MinY , sizeof(Double_t) );
459  infile.read( (Char_t*) &Extents::MaxY , sizeof(Double_t) );
460  infile.read( (Char_t*) &dummyf , sizeof(Float_t) ); // for format compliance
461 
462  minx=Extents::MinX;
463  maxx=Extents::MaxX;
464  miny=Extents::MinY;
465  maxy=Extents::MaxY;
466 
467  // 16 bytes
468  infile.read( (Char_t*) &TopTracksLength , sizeof(Int_t) ); // n. of MIPIndexedEmulsionTrack
469  infile.read( (Char_t*) &BottomTracksLength , sizeof(Int_t) ); // n. of MIPIndexedEmulsionTrack
470  infile.read( (Char_t*) &TracksLength , sizeof(Int_t) ); // n. of MIPBaseTrack
471  infile.read( (Char_t*) &dummyui , sizeof(UInt_t) ); // count of fields
472 
473  // 34 bytes
474  infile.read( (Char_t*) &Top_TopZ , sizeof(Double_t) ); // topext
475  infile.read( (Char_t*) &Top_BottomZ , sizeof(Double_t) ); // topInt_t
476  infile.read( (Char_t*) &Bottom_TopZ , sizeof(Double_t) ); // bottomInt_t
477  infile.read( (Char_t*) &Bottom_BottomZ , sizeof(Double_t) ); // bottomext
478  infile.read( (Char_t*) &dummych , sizeof(Char_t) ); // skip fields
479  infile.read( (Char_t*) &dummych , sizeof(Char_t) ); // skip fields
480 
481  //print_Header();
482 
483  using namespace MIPEmulsionTrack ;
484  for (int s=0; s<2; s++ ) {
485  en_side side = ( s==0? TOP : BOT ) ;
486  int ntracks = ( s==0 ? TopTracksLength : BottomTracksLength );
487  for (int i=0; i<ntracks; i++ ) {
488  // 84 bytes
489  infile.read( (Char_t*) &Field , sizeof(UInt_t) );
490  infile.read( (Char_t*) &AreaSum , sizeof(UInt_t) );
491  infile.read( (Char_t*) &Count , sizeof(UInt_t) );
492  infile.read( (Char_t*) &X , sizeof(Double_t) );
493  infile.read( (Char_t*) &Y , sizeof(Double_t) );
494  infile.read( (Char_t*) &Z , sizeof(Double_t) );
495  infile.read( (Char_t*) &SX , sizeof(Double_t) );
496  infile.read( (Char_t*) &SY , sizeof(Double_t) );
497  infile.read( (Char_t*) &SZ , sizeof(Double_t) );
498  infile.read( (Char_t*) &Sigma , sizeof(Double_t) );
499  infile.read( (Char_t*) &TopZ , sizeof(Double_t) );
500  infile.read( (Char_t*) &BottomZ , sizeof(Double_t) );
501 
502  //print_MIPEmulsionTrack( s, i ) ;
503  if(X<minx-1000) continue;
504  if(X>maxx+1000) continue;
505  if(Y<miny-1000) continue;
506  if(Y>maxy+1000) continue;
507  Add_MIPEmulsionTrack ( side, i, ptop, pbot );
508  }
509  }
510 
511  using namespace MIPBaseTrack ;
512  for (int i=0; i<TracksLength; i++ ) {
513  // .. bytes
514  infile.read( (Char_t*) &MIPBaseTrack::AreaSum , sizeof(UInt_t) );
515  infile.read( (Char_t*) &MIPBaseTrack::Count , sizeof(UInt_t) );
516  infile.read( (Char_t*) &MIPBaseTrack::X , sizeof(Double_t) );
517  infile.read( (Char_t*) &MIPBaseTrack::Y , sizeof(Double_t) );
518  infile.read( (Char_t*) &MIPBaseTrack::Z , sizeof(Double_t) );
519  infile.read( (Char_t*) &MIPBaseTrack::SX , sizeof(Double_t) );
520  infile.read( (Char_t*) &MIPBaseTrack::SY , sizeof(Double_t) );
521  infile.read( (Char_t*) &MIPBaseTrack::SZ , sizeof(Double_t) );
522  infile.read( (Char_t*) &MIPBaseTrack::Sigma , sizeof(Double_t) );
523  if (headerformat == (UShort_t)File::Format::NoExtents) {
524  // Int_tercept errors and slope errors
525  for (int j=0; j<6; j++)
526  infile.read( (Char_t*) &dummyd , sizeof(Double_t) );
527  }
528  infile.read( (Char_t*) &MIPBaseTrack::TopId , sizeof(Int_t) );
529  infile.read( (Char_t*) &MIPBaseTrack::BottomId , sizeof(Int_t) );
530 
531  //print_MIPBaseTrack( i ) ;
532  Add_MIPBaseTrack( i, base, ptop, pbot, project_dz);
533  }
534 
535  using namespace TrackIndexEntry ;
536  for (int s=0; s<2; s++ ) {
537  int ntracks = ( s==0 ? TopTracksLength : BottomTracksLength );
538  for (int i=0; i<ntracks; i++ )
539  {
540  infile.read( (Char_t*) &TrackIndexEntry::Fragment , sizeof(Int_t) );
541  infile.read( (Char_t*) &TrackIndexEntry::View , sizeof(Int_t) );
542  infile.read( (Char_t*) &TrackIndexEntry::Track , sizeof(Int_t) );
543 
544  //printrackIndexEntry( s , i ) ;
545  }
546  }
547  }
548  else
549  {
550 
551  }
552 
553  infile.close() ;
554 
555 }
struct @8 Z
return
Definition: energy.C:49
Float_t dummyf
Definition: merge_Energy_SytematicSources_Electron.C:9
@ NormalWithIndex
Definition: tlg2pattern.C:59
@ NormalDouble_tWithIndex
Definition: tlg2pattern.C:60
@ NoExtents
Definition: tlg2pattern.C:57
@ Old
Definition: tlg2pattern.C:55
@ Detailed
Definition: tlg2pattern.C:61
@ Old2
Definition: tlg2pattern.C:56
@ Normal
Definition: tlg2pattern.C:58
@ MultiSection
Definition: tlg2pattern.C:62
@ Track
Definition: tlg2pattern.C:53
@ Header
Definition: tlg2pattern.C:54
Double_t X
Definition: tlg2pattern.C:77
Double_t Y
Definition: tlg2pattern.C:77
const Char_t SectionTag
Definition: tlg2pattern.C:67
UInt_t id
Definition: tlg2pattern.C:118
void Add_MIPBaseTrack(int i, EdbPattern &base, EdbPattern &ptop, EdbPattern &pbot, float project_dz=-105.)
Definition: tlg2pattern.C:235
void Add_MIPEmulsionTrack(en_side side, int i, EdbPattern &ptop, EdbPattern &pbot)
Definition: tlg2pattern.C:203
en_side
Definition: tlg2pattern.C:37

Variable Documentation

◆ cp

EdbSegCouple* cp = 0

◆ Pid1

Int_t Pid1 =0

◆ Pid2

Int_t Pid2 =0

◆ s

TString s = 0

◆ s1

EdbSegP* s1 = 0

◆ s2

EdbSegP* s2 = 0

◆ Xv

Float_t Xv =0

◆ Yv

Float_t Yv =0