Fork me on GitHub

Ignore:
Timestamp:
Feb 12, 2019, 9:29:17 PM (6 years ago)
Author:
Pavel Demin <pavel-demin@…>
Branches:
ImprovedOutputFile, Timing, llp, master
Children:
6455202
Parents:
45e58be
Message:

apply .clang-format to all .h, .cc and .cpp files

File:
1 edited

Legend:

Unmodified
Added
Removed
  • classes/DelphesSTDHEPReader.cc

    r45e58be r341014c  
    1717 */
    1818
    19 
    2019/** \class DelphesSTDHEPReader
    2120 *
     
    2827#include "classes/DelphesSTDHEPReader.h"
    2928
    30 #include <stdexcept>
    3129#include <iostream>
    3230#include <sstream>
    33 
    34 #include <stdio.h>
     31#include <stdexcept>
     32
    3533#include <errno.h>
    3634#include <stdint.h>
     35#include <stdio.h>
    3736#include <string.h>
    3837
     38#include "TDatabasePDG.h"
     39#include "TLorentzVector.h"
    3940#include "TObjArray.h"
     41#include "TParticlePDG.h"
    4042#include "TStopwatch.h"
    41 #include "TDatabasePDG.h"
    42 #include "TParticlePDG.h"
    43 #include "TLorentzVector.h"
    4443
    4544#include "classes/DelphesClasses.h"
     
    5150using namespace std;
    5251
    53 static const int kBufferSize  = 1000000;
     52static const int kBufferSize = 1000000;
    5453
    5554//---------------------------------------------------------------------------
     
    5857  fInputFile(0), fBuffer(0), fPDG(0), fBlockType(-1)
    5958{
    60   fBuffer = new uint8_t[kBufferSize*96 + 24];
     59  fBuffer = new uint8_t[kBufferSize * 96 + 24];
    6160
    6261  fPDG = TDatabasePDG::Instance();
     
    117116    ReadEventHeader();
    118117  }
    119   else if(fBlockType == MCFIO_STDHEPBEG ||
    120           fBlockType == MCFIO_STDHEPEND)
     118  else if(fBlockType == MCFIO_STDHEPBEG || fBlockType == MCFIO_STDHEPEND)
    121119  {
    122120    ReadSTDCM1();
     
    170168  uint32_t size;
    171169  fReader[0].ReadValue(&size, 4);
    172   SkipBytes(size*elsize);
     170  SkipBytes(size * elsize);
    173171}
    174172
     
    178176{
    179177  uint32_t i;
    180   enum STDHEPVersion {UNKNOWN, V1, V2, V21} version;
     178  enum STDHEPVersion
     179  {
     180    UNKNOWN,
     181    V1,
     182    V2,
     183    V21
     184  } version;
    181185
    182186  // version
    183187  fReader[0].ReadString(fBuffer, 100);
    184   if(fBuffer[0] == '\0' || fBuffer[1] == '\0') version = UNKNOWN;
    185   else if(fBuffer[0] == '1') version = V1;
    186   else if(strncmp((char *)fBuffer, "2.01", 4) == 0) version = V21;
    187   else if(fBuffer[0] == '2') version = V2;
    188   else version = UNKNOWN;
     188  if(fBuffer[0] == '\0' || fBuffer[1] == '\0')
     189    version = UNKNOWN;
     190  else if(fBuffer[0] == '1')
     191    version = V1;
     192  else if(strncmp((char *)fBuffer, "2.01", 4) == 0)
     193    version = V21;
     194  else if(fBuffer[0] == '2')
     195    version = V2;
     196  else
     197    version = UNKNOWN;
    189198
    190199  if(version == UNKNOWN)
     
    363372  // 4 + 4 + 4 + 4 + 4 + 4 = 96*n + 24
    364373
    365   fReader[0].ReadRaw(fBuffer, 96*fEventSize + 24);
     374  fReader[0].ReadRaw(fBuffer, 96 * fEventSize + 24);
    366375
    367376  fReader[1].SetBuffer(fBuffer);
    368   fReader[2].SetBuffer(fBuffer + 4*1 + 4*1*fEventSize);
    369   fReader[3].SetBuffer(fBuffer + 4*2 + 4*2*fEventSize);
    370   fReader[4].SetBuffer(fBuffer + 4*3 + 4*4*fEventSize);
    371   fReader[5].SetBuffer(fBuffer + 4*4 + 4*6*fEventSize);
    372   fReader[6].SetBuffer(fBuffer + 4*5 + 4*16*fEventSize);
     377  fReader[2].SetBuffer(fBuffer + 4 * 1 + 4 * 1 * fEventSize);
     378  fReader[3].SetBuffer(fBuffer + 4 * 2 + 4 * 2 * fEventSize);
     379  fReader[4].SetBuffer(fBuffer + 4 * 3 + 4 * 4 * fEventSize);
     380  fReader[5].SetBuffer(fBuffer + 4 * 4 + 4 * 6 * fEventSize);
     381  fReader[6].SetBuffer(fBuffer + 4 * 5 + 4 * 16 * fEventSize);
    373382
    374383  fReader[1].ReadValue(&idhepSize, 4);
     
    391400  fAlphaQCD = 0.0;
    392401  fScaleSize = 0;
    393   memset(fScale, 0, 10*sizeof(double));
     402  memset(fScale, 0, 10 * sizeof(double));
    394403}
    395404
     
    494503
    495504    pdgParticle = fPDG->GetParticle(pid);
    496     candidate->Charge = pdgParticle ? int(pdgParticle->Charge()/3.0) : -999;
     505    candidate->Charge = pdgParticle ? int(pdgParticle->Charge() / 3.0) : -999;
    497506    candidate->Mass = mass;
    498507
Note: See TracChangeset for help on using the changeset viewer.