Loading code/CXYZSD.cc +3 −0 Original line number Diff line number Diff line Loading @@ -87,6 +87,7 @@ void CXYZSD::Initialize(G4HCofThisEvent* HCE) { info_primaryEventID = 0; gm.config->readInto(writeToMongoDB, "IO.FILETYPE.MONGODB.WriteToServer"); } Loading Loading @@ -398,12 +399,14 @@ void CXYZSD::EndOfEvent(G4HCofThisEvent* HCE) { #ifdef MONGODB if(gm.enableWriteMONGODB && gm.enableWriteXYZ) { if (!writeToMongoDB) mutex_write.lock(); if(NbHits > 0) { for (G4int i=0; i<NbHits; i++) { CXYZHit* hit = (*xyzhitCollection)[i]; gm.mongodb_xyz->writeData(hit, i); } } if (!writeToMongoDB) mutex_write.unlock(); } #endif } Loading code/CXYZSD.hh +2 −0 Original line number Diff line number Diff line Loading @@ -51,6 +51,8 @@ public: G4String GetVolumeName(int flag, int ndepth, G4Step* aStep); int GetMotherID(int flag, int ndepth, G4Step* aStep); bool writeToMongoDB = true; // true = upload, false = write local file only private: CHitsXYZCollection* xyzhitCollection; Loading code/MongoOutput_XYZ.hh +1 −1 Original line number Diff line number Diff line Loading @@ -44,7 +44,7 @@ public: mongocxx::pool pool{uri}; bool writeToMongoDB; // true = upload, false = write local file only bool writeToMongoDB = true; // true = upload, false = write local file only ofstream bson_local_file; string local_bson_filename; Loading Loading
code/CXYZSD.cc +3 −0 Original line number Diff line number Diff line Loading @@ -87,6 +87,7 @@ void CXYZSD::Initialize(G4HCofThisEvent* HCE) { info_primaryEventID = 0; gm.config->readInto(writeToMongoDB, "IO.FILETYPE.MONGODB.WriteToServer"); } Loading Loading @@ -398,12 +399,14 @@ void CXYZSD::EndOfEvent(G4HCofThisEvent* HCE) { #ifdef MONGODB if(gm.enableWriteMONGODB && gm.enableWriteXYZ) { if (!writeToMongoDB) mutex_write.lock(); if(NbHits > 0) { for (G4int i=0; i<NbHits; i++) { CXYZHit* hit = (*xyzhitCollection)[i]; gm.mongodb_xyz->writeData(hit, i); } } if (!writeToMongoDB) mutex_write.unlock(); } #endif } Loading
code/CXYZSD.hh +2 −0 Original line number Diff line number Diff line Loading @@ -51,6 +51,8 @@ public: G4String GetVolumeName(int flag, int ndepth, G4Step* aStep); int GetMotherID(int flag, int ndepth, G4Step* aStep); bool writeToMongoDB = true; // true = upload, false = write local file only private: CHitsXYZCollection* xyzhitCollection; Loading
code/MongoOutput_XYZ.hh +1 −1 Original line number Diff line number Diff line Loading @@ -44,7 +44,7 @@ public: mongocxx::pool pool{uri}; bool writeToMongoDB; // true = upload, false = write local file only bool writeToMongoDB = true; // true = upload, false = write local file only ofstream bson_local_file; string local_bson_filename; Loading